...
In other words, when you access a *.action
URL, WebWork's ServletDispatcher
proceeds to the invocation of the an action object. Before it is executed, however, the invocation can be intercepted by another object, that is hence called interceptor. To have an interceptor executed before (or after) a given action,
Interceptor configuration
...
:
Code Block | ||||
---|---|---|---|---|
| ||||
<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN" "http://www.opensymphony.com/xwork/xwork-1.1.dtd"> <xwork> <!-- Include webwork defaults (from WebWork JAR). --> <include file<package name="default" extends="webwork-default.xml"/> <interceptors> <!-- Configuration for the default package. --<interceptor name="timer" class=".."/> <package <interceptor name="defaultlogger" extendsclass="webwork-default.."/> </interceptors> <action name="listPeople"login" class="com.acme.ListPeopleorg.hibernate.auction.web.actions.users.Login"> <result type<interceptor-ref name="freemarkertimer">listPeople.ftl</result>> </action> <interceptor-ref name="logger"/> <action<result name="newPerson" class="com.acme.CreatePerson">input">login.jsp</result> <result typename="redirectsuccess">listPeople.action</result> <result name="input" type="freemarker">newPerson.ftl<redirect">/secure/dashboard.action</result> </action> </package> </xwork> |
Grouping interceptors as stacks
...