...
Code Block |
---|
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> |
New Features and Extensions
- Acegi Security extension is available.
- JavaServer Faces extension is available.
Key Changes
Depending on whether you are coming from a Struts 1 or a WebWork 2 or Struts 1 background, your perspective on the key changes will differ.
From Struts 1
- See Comparing Struts 1 and 2
- More notes to come ...
From WebWork 2
- Struts 2 is dependant on XWork 2 (nightly build).
- Java 1.5 is required to build and deploy Struts 2.
- For Java 1.4 deployments, RetroWeaver or RetroTranslater may be used to provide Java 1.4 support
- A pre-packaged set of RetroTranslator JARs are being provided with the distribution.
For other changes from WebWork 2, see the "Members to rename", "New property settings", "New members featrues or feature changes", and "Removed or deprecated".
...
Tip |
---|
It is recommended that all applications specify the DynamicMethodInvocation setting for now, since the default may change. The recommended approach to action aliasing is to use wildcard aliases instead of the hardwired bang. |
New
...
features and feature changes
- Datepicker tag is now using dojo's (limited in terms functionality and internationalization)
- Various changes to ConfigurationManager
- ConfigurationManager is no longer a static factory. It is now an instance created through Dispatcher. Custom configuration could be done through DispatcherListener.
- Custom configuration to ConfigurationManager and Configuration cannot be done statically anymore, instead use Dispatcher's DispatcherListener to achieve the same effect.
- The
prepare
interceptor now uses reflection to call prepare_Method_ where method is the action method configured for the particular action instruts.xml
.Code Block <action name="myAction" method="insert" ....> ..... </action> // with the above configuration, and PrepareInterceptor in play, // callsequence will be 1] prepareInsert() (If it exists) 2] prepare() (Unless Interceptor's alwaysInvokePrepare parameter is set to false) 3] insert()
- DefaultWorkflowInterceptor (named
workflow
instruts-default.xml
) now uses reflection to callvalidateMethod
on the action class that implements Validateable interface wheremethod
is the action method configured for the particular action instruts.xml
.Code Block <action name="myAction" method="insert" ...> ... </action> // with the above configuration, and DefaultWorkflowInterceptor in play, // call sequence for action that implements Validateable interface will be 1] validateInsert() 2] validate() (unless Interceptor's alwaysInvokeValidate parameter is set to false) 3] insert()
- Datepicker tag is now using dojo's (limited in terms functionality and internationalization)
- Tiles integration extension is available.
- Wildcards can be specified in action mappings.
Removed or deprecated
AroundInterceptor | The AroundInterceptor has been removed. If your application extends the AroundInterceptor, either import the class into your source code form WebWork 2 (pursuant to the Open Symphony License) and modify it to server as your own base class, or rewrite your interceptor. | ||
---|---|---|---|
| Support for the "oldSyntax" is removed. | ||
Rich text editor tag | Rich text editor tag has been removed (a possible replacement would be to use the textarea tag with theme="ajax", this will used dojo's rich text editor)
| ||
| The convention of trying a "do" form of an action method is not supported.
In WebWork,
| ||
| Calling the "default" method via "doDefault" is not supported. |
From Struts 1
...
. |
Detail
...