Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Overriding default interceptor stack

 
Renga Ramanujam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In my application we have a customized interceptor stack. It acts as a default interceptor stack. This stack doesnt have validation and workflow attached with it. Now for a specific action class we need to use validate() method.
So we created a new interceptor stack with validation and work flow interceptor.

But still default interceptor alone getting called, the new one is not getting called. Can someone please help me?

Regards,
Renga
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
whatever interceptors are included in to your interceptors stack those only going to execute, post your interceptors stack how you declared.
 
Renga Ramanujam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please find my interceptor stack configuration along with action classes below.

<package name="default" extends="struts-default">
<interceptor-stack name=”AppStack”>
<interceptor-ref name="exception"/>
<interceptor-ref name="alias"/>
<interceptor-ref name="params"/>
<interceptor-ref name="servletConfig"/>
<interceptor-ref name="params"/>

</interceptor-stack>

<interceptor-stack name=”GuiStack”>
<interceptor-ref name="exception"/>
<interceptor-ref name="alias"/>
<interceptor-ref name="params"/>
<interceptor-ref name="servletConfig"/>
<interceptor-ref name="params"/>
<interceptor-ref name="validation" />
<interceptor-ref name="workflow" />

</interceptor-stack>

<default-interceptor-ref name="AppStack"/>


<action name="test"
class="com.jranch.Test">
<interceptor-ref name="GuiStack”/>
<result name="input">login.jsp</result>
<result name="success"
type="redirect-action">/secure/home</result>
</action>
</package>


The problem which I am facing is in Test class validate method is not getting called, If I add the validation and workflow interceptor to AppStack it works fine but I cant do that because it affects already existing classes
 
Jesus Mireles
Ranch Hand
Posts: 122
IntelliJ IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks right except im sure you have the interceptor stacks wrapped in a interceptors tag even though you dont post like that?

Anyway, you should turn up debug and you'll see what interceptors are being used.

 
Renga Ramanujam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah looks right to me too. Can we never override default interceptor stack? How can we check which interceptors have buit?
 
Renga Ramanujam
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Its resolved now. The problem is the new interceptor stack is present different XML. It was not properly included in mail struts.xml. Sorry for the disturbance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic