Warning | ||
---|---|---|
| ||
This is a work in progress and not yet finished! More complex examples will follow. For now, have a look at the unit tests within the xwork-tiger project path. |
To use Java 5 support Annotations with the framework, you have to add struts-action-tiger.jar
to your classpath.
The struts-action-tiger.jar
can be obtained via the Maven repository and is located in the lib/tiger
directory.
Interceptor Annotations
To use these annotations, you have to specify the AnnotationWorkflowInterceptor to your interceptor stack.
Annotation | Description |
---|---|
Marks a action method that needs to be executed before the result. | |
Marks a action method that needs to be executed before the main action method. | |
Marks a action method that needs to be executed before the result. |
Validation Annotations
If you want to use annotation based validation, you have to annotate the class or interface with Validation Annotation.
...
Annotation | Description |
---|---|
Checks if there are any conversion errors for a field. | |
Checks that a date field has a value within a specified range. | |
Checks that a double field has a value within a specified range. | |
Checks that a field is a valid e-mail address. | |
Validates an expression. | |
Uses an OGNL expression to perform its validator. | |
Checks that a numeric field has a value within a specified range. | |
Validates a regular expression for a field. | |
Checks that a field is non-null. | |
Checks that a String field is not empty. | |
Checks that a String field is of the right length. | |
| |
Checks that a field is a valid URL. | |
Marker annotation for validation at Type level. | |
Used to group validation annotations. | |
| |
Use this annotation for your custom validator types. |
Type Conversion Annotations
If the xwork-tigerjar is added to the classpath, you will directly have type conversion support for Maps and Collections using generics.
...
Annotation | Description |
---|---|
Marker annotation for type conversions at Type level. | |
For Collection and Map types: Create the types within the Collection or Map, if null. | |
For Generic types: Specify the element type for Collection types and Map values. | |
For Generic types: Specify the key type for Map keys. | |
For Generic types: Specify the key property name value. | |
Used for class and application wide conversion rules. |
Create ClassName-conversion.properties via "ant apt" target
This is an example for the apt ant target:
...