What are Struts 2 features?

What are Struts 2 features?

The important features of struts 2 framework are as follows:

  • Configurable MVC components.
  • POJO based actions.
  • AJAX support.
  • Integration support.
  • Various Result Types.
  • Various Tag support.
  • Theme and Template support.

What is the difference between Struts 1 and 2?

Struts 1 requires Action classes to extend an abstract base class. An Struts 2 Action may implement an Action interface, along with other interfaces to enable optional and custom services. Struts 2 provides a base ActionSupport class to implement commonly used interfaces.

What are interceptors in struts?

Interceptor is an object that is invoked at the preprocessing and postprocessing of a request. In Struts 2, interceptor is used to perform operations such as validation, exception handling, internationalization, displaying intermediate result etc.

What are Struts 2 framework components?

What are Struts2 core components?

  • Action Classes.
  • Interceptors.
  • Result Pages, JSP of FreeMarker templates.
  • ValueStack, OGNL and Tag Libraries.

Do you need to extend Apache Struts dispatchaction?

It’s a useful mechanism to avoid create separate action classe for each function. To implement this mechanism, your action class need to extends org.apache.struts.actions.DispatchAction class, this action class does not need to implement the execute () method as normal action class does.

How is execute ( ) implemented in struts dispatch action?

This class does not provide an implementation for the execute () method because DispatchAction class itself implements this method. This class manages to delegate the request to one of the methods of the derived Action class. An Action Mapping is done to select the particular method (via Struts-Configuration file).

Which is an example of a struts action class?

A action class extends the DispatchAction, and contains four methods to set the locale into the Struts session attribute for the localization. This Struts html tag will execute the chinese () method. This Struts html tag will execute the english () method. This Struts html tag will execute the german () method.

How to execute the Chinese ( ) method in struts?

For example, if the parameter is “method=chinese”, then the chinese () method will be execute. A action class extends the DispatchAction, and contains four methods to set the locale into the Struts session attribute for the localization. This Struts html tag will execute the chinese () method.

About the Author

You may also like these