I discovered that if you need to have a interceptor called when going to a .jsp page you can simple create an EmptyAction.java file which has one method execute and one line in it return SUCCESS. 
 

public class EmptyAction extends ActionSupport{

public String execute() throws Exception {

return SUCCESS;

}

}

Then in the xwork.xml file I can call that action anything like promptAddStoryAction which simply has one result of success to the .jsp that I wanted. 
 

<action name="PromptAddStoryAction" class="com.wafer.actions.EmptyAction">

<result name="success" type="dispatcher">

<param name="location">/addstory.jsp</param>

</result>

<interceptor-ref name="security"/>

</action>

 So this means that any interceptor stack associated to that action will now get called!
 
And of course the EmptyAction class is completely resusable.
 
Is there a better way to call interceptors when just trying to go to a jsp?
 
 
 
Kris Thompson

Reply via email to