Course Details
Duration: 3 Days
Delegates must have a minimum of three years Java programming experience, preferably in JEE Web Application development. In addition they should be proficient in authoring HTML/XML documents and familiar with the HTTP protocol and core concepts of AJAX.
Overview
This course provides an extremely detailed and comprehensive introduction to the Spring and Spring MVC Web Framework. By default only the modern, annotation driven, edition of the framework is covered (sometimes referred to as Spring @MVC) – but legacy features from earlier versions can be included if required.
In addition to conventional web development the course also covers using the new features introduced in Spring 3 to create REST’ful Web Services, which communicate with AJAX based clients using JSON for data exchange. Dojo is the AJAX framework used by default but other options (such as JQuery) can be used instead.
List of Modules
Review of Core Spring Concepts (Optional)
- The benefits of Dependency Injection in OO development
- Performing DI in Spring using XML bean definition files
- How schema extensions enhance the core bean-wiring language
- Performing DI in Spring 2.5 and above using annotations
- Using Spring Expression Language to enhance DI
- How Spring adds services on top of DI via AOP
Introduction to Spring MVC
- The architecture of Spring MVC
- Configuring the Spring Dispatcher Servlet
- Placing web configuration in a separate XML file
- Using the MVC schema extension to simplify configuration
- Options for associating controller classes with URL’s
- The role of handler mappings and view resolvers
- Overview of the built in mappers and resolvers
Mapping URL’s to Controller Methods
- Associating a controller with a single URL
- Mapping methods to different HTTP verbs (GET, POST, PUT etc…)
- Placing multiple business methods in the same controller
- Executing a method based on the presence of a parameter
- Executing a method based on the presence of a header
Receiving Input from the HTTP Request
- Using @RequestParam to inject individual parameters
- Populating a JavaBean with multiple parameters from the request
- Using path variables to inject information from the URL
- Injecting information from HTTP headers and cookies
- Working with the entire body via @RequestBody
- Passing objects from the Servlet API into business methods
Validating Input and Producing Output
- Processing structured input via converters
- Processing date and time input using @DateTimeFormat
- Writing and calling your own validator objects
- Validation using Springs support for JSR-303
- Options for calling business services
- Adding attributes to the model object
Options for Generating Views
- Using @ResponseBody to bypass view pages
- Using standard JSP pages for rendering
- Making use of the MVC tag library in JSP’s
- Creating composite views via the Tiles library
- Using FreeMarker or Velocity instead of JSP’s
- Using XSLT instead of conventional view pages
- Configuring multiple view resolvers
- Internationalizing view pages
Moving from Web Applications to REST
- Review of the key concepts of REST’ful services
- Pros and cons of REST over SOAP’y services
- Writing REST’ful clients in Java using Apache HttpClient
- Writing REST’ful clients in Java using the Spring 3 RestTemplate
- Writing REST’ful clients in AJAX using Dojo
Using Spring MVC in REST’ful Scenarios
- Using ContentNegotiatingViewResolver to handle multiple client types
- Converting XML and JSON input into objects via JAXB and Jackson
- Returning data feeds via AbstractAtomFeedView and AbstractRssFeedView
- Returning XML via MarshallingView and JSON via JacksonJsonView
Interested?
We are more than happy to discuss any training options with you in detail or help you decide which course is right for you.
To ensure that your specific needs are met, we offer customised versions of all our training courses, as well as pre and post workshop consultancy to help facilitate the introduction of training material into your organisation.
Call our team on: +44 2890 278498
Email us at: enquiries@instil.co