...
Set the "actionPackages" filter init param to a comma-separated list of packages containing Action classes in web.xml. The packages and their subpackages will be scanned. All classes in the designated packages that implement Action or end in "Action" are examined. The latter is to allow for POJO Actions that don't implement the Action interface.
Code Block | |||||||
---|---|---|---|---|---|---|---|
| |||||||
<filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> <init-param> <param-name>actionPackages</param-name> <param-value>com.foo.bar,com.baz.quux</param-value> </init-param> </filter> |
...
The subpackage name makes the namespace, and the action class name makes the action name. If there is an "Action" suffix, it is dropped before creating the action name. Therefore, if the configured package is com.myapp.actions and the Action is com.myapp.actions.member.EditAction, you can access it via http://server/myapp/member/edit.action. For multi-word actions, the first letter is lower-cased and the rest is left alone, so the Action MyCustomAction
will map to myCustom.action
.
...