Pages

Saturday, October 6, 2007

Struts 2 Help




Interceptor:-

Interceptors can execute code before and after an Action is invoked. Most of the framework's core functionality is implemented as Interceptors. Features like double-submit guards, type conversion, object population, validation, file upload, page preparation, and more, are all implemented with the help of Interceptors. Each and every Interceptor is pluggable, so you can decide exactly which features an Action needs to support.

Interceptors can be configured on a per-action basis. Your own custom Interceptors can be mixed-and-matched with the Interceptors bundled with the framework. Interceptors "set the stage" for the Action classes, doing much of the "heavy lifting" before the Action executes.


Result Types

Most use cases can be divided into two phases. First, we need to change or query the application's state, and then we need to present an updated view of the application. The Action class manages the application's state, and the Result Type manages the view.

Predefined Result Types

The framework provides several implementations of the com.opensymphony.xwork2.Result interface, ready to use in your own applications.

Chain Result Used for Action Chaining
Dispatcher Result Used for web resource integration, including JSP integration
FreeMarker Result Used for FreeMarker integration
HttpHeader Result Used to control special HTTP behaviors
Redirect Result Used to redirect to another URL (web resource)
Redirect Action Result Used to redirect to another action mapping
Stream Result Used to stream an InputStream back to the browser (usually for file downloads)
Velocity Result Used for Velocity integration
XSL Result Used for XML/XSLT integration
PlainText Result Used to display the raw content of a particular page (i.e jsp, HTML)
S2PLUGINS:Tiles Result Used to provide Tiles integration

Optional

JasperReports Plugin Used for JasperReports Tutorial integration Optional, third-party plugin

Additional Result Types can be created and plugged into an application by implementing the com.opensymphony.xwork2.Result interface. Custom Result Types might include generating an email or JMS message, generating images, and so forth.


Editors / IDE for Struts 2

  1. NetBeans
  2. IDEA IntelliJ
  3. Eclipse
Above Editors/IDE helps you to build your Struts 2 project.
Build your struts 2 project using above IDE.



1 comment:

Anoushka Sakthi said...

Java is a prominent programming language in the current IT industry and the advanced level of Java courses are wanted by most of the professional. Your blog help me to observe some important points in Java language.
Regards:
free java training in chennai | Core Java Training

Google
 

Java-Struts