So, I've edited the struts.xml appropriately and I've created an
Interceptor that implements the interceptor interface. Init() is
called on startup but I can't get it to call intercept() to save my
life. My objective is to create an interceptor that checks to see if a
session variable is set and if not then take some action (either set
it or send the user to a page that sets it).
Here is the interceptor:
public class UidInterceptor implements Interceptor {
private static final Logger LOG = LoggerFactory.getLogger("sigacts");
public void destroy() {
LOG.debug("jim May 27, 2009 : destroy called");
}
public void init() {
LOG.debug("jim May 27, 2009 : init called ");
}
public String intercept(ActionInvocation invocation) throws Exception {
LOG.debug("jim May 27, 2009 : intercept called");
return invocation.invoke();
}
}
Here is the relevant portion of the xml:
<package name="xxx" extends="struts-default">
<interceptors>
<interceptor name="UidIntercept"
class="com.eds.xxx.web.admin.UidInterceptor"/>
<interceptor-stack name="CustomStack">
<interceptor-ref name="paramsPrepareParamsStack"/>
<interceptor-ref name="UidIntercept"/>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="CustomStack"/>
</package>
Clues anyone? I can see the init() being called in the logs but I
never see intercept.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]