Struts Course

 

Struts

Course Overview

Web applications differ from conventional websites in that web applications can create a dynamic response. Many websites deliver only static pages. A web application can interact with databases and business logic engines to customize a response.

Web applications based on Java Server Pages sometimes commingle database code, page design code, and control flow code. In practice, we find that unless these concerns are separated, larger applications become difficult to maintain.

One way to separate concerns in a software application is to use a Model-View-Controller (MVC) architecture. The Model represents the business or database code, the View represents the page design code, and the Controller represents the navigational code. The Struts framework is designed to help developers create web applications that utilize a MVC architecture.

Apache Struts is a free, open-source, MVC framework for creating elegant, modern Java web applications. It favors convention over configuration, is extensible using a plugin architecture, and ships with plugins to support REST, AJAX and JSON.

The modern web application framework, saying hello to Struts 2, working with Struts 2 actions, Adding workflow with interceptors, Data transfer: OGNL and type conversion, Building a view: tags, UI component tags. Integrating with spring and Hibernate/JPA, Exploring the validation framework, Understanding internationalization, Extending Struts 2 with plug-ins and more.

Struts Course Syllabus

The modern web application framework

  • Web applications: a quick study
  • Frameworks for web applications
  • The Struts 2 framework

Saying hello to Struts 2

  • Declarative architecture
  • A quick hello
  • HelloWorld using annotations

Working with Struts 2 actions

  • Introducing Struts 2 actions
  • Packaging your actions
  • Implementing actions
  • Transferring data onto objects
  • File uploading: a case study

Adding workflow with interceptors

  • Why intercept requests?
  • Interceptors in action
  • Surveying the built-in Struts 2 interceptors
  • Declaring interceptors
  • Building your own interceptor

Data transfer: OGNL and type conversion

  • Data transfer and type conversion: common tasks of the web application domain
  • OGNL and Struts 2
  • Built-in type converters
  • Customizing type conversion

Building a view: tags

  • Getting started
  • An overview of Struts tags
  • Data tags
  • Control tags
  • Miscellaneous tags
  • Using JSTL and other native tags
  • A brief primer for the OGNL expression language

UI component tags

  • Why we need UI component tags
  • Tags, templates, and themes
  • UI Component tag reference

Results in detail

  • Life after the action
  • Commonly used result types
  • JSP alternatives
  • Global results

Integrating with spring and Hibernate/JPA

  • Why use spring with Struts 2?
  • Adding Spring to Struts 2
  • Why use the Java Persistence API with Struts 2?

Exploring the validation framework

  • Getting familiar with the validation framework
  • Wiring your actions for validation
  • Writing a custom validator
  • Validation framework advanced topics

Understanding internationalization

  • The Struts 2 framework and Java i18n
  • A Struts 2 i18n demo
  • Struts 2 i18n: the details
  • Overriding the framework’s default locale determination

Extending Struts 2 with plug-ins

  • Plug-in overview
  • Common plug-ins
  • Internal component system
  • Writing a breadcrumb plug-in

Best practices

  • Setting up your environment
  • Unit-testing your actions
  • Maximizing reuse
  • Advanced UI tag usage

Migration from Struts Classic

  • Translating Struts Classic knowledge
  • Converting by piecemeal

Advanced topics

  • Advanced action usage
  • Dynamic method invocation
  • Using tokens to prevent duplicate form submits
  • Displaying wait pages automatically
  • A single action for CRUD operations
  • Tiles and Struts 2