aspose file tools*
The moose likes Struts and the fly likes problem in configuring interceptor in struts.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in configuring interceptor in struts.xml" Watch "problem in configuring interceptor in struts.xml" New topic
Author

problem in configuring interceptor in struts.xml

rajiv shrestha
Ranch Hand

Joined: Aug 25, 2010
Posts: 30


Here i have class "SessionInterceptor" for session management.
In above i have created interceptor stack and included in all action where i need with the navigation for session expired as




If i have more actions then i do have to include interceptor-ref and <result name="session">/sessionexpired.jsp</result> in all which seems time consuming. Is there any approach so that i don't have to include this in all actions ?

thank you in advance.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9305
    
  17

Check the interceptor configuration to see how to configure a default interceptor stack and result configuration to see how to define global results...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
rajiv shrestha
Ranch Hand

Joined: Aug 25, 2010
Posts: 30
Ankit Garg wrote:Check the interceptor configuration to see how to configure a default interceptor stack and result configuration to see how to define global results...


hi ankit, thank you for the response.

i modified like this.


Is this the right process to use default interceptor and global result?
But its not working.
I need some assist.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9305
    
  17

But its not working.

Please be more specific about the problem...
rajiv shrestha
Ranch Hand

Joined: Aug 25, 2010
Posts: 30
Ankit Garg wrote:
But its not working.

Please be more specific about the problem...



my problem is i want the interceptor stack , "sessionStack" that i made to be included in all necessary actions and the result for sessionexpired.jsp.
As this can be done by default-interceptor-ref for interceptor and global results for the results. i have tried like the above code in the struts.xml. i want to maintain the session with this, but its not working. i directly goes to sessionexpired.jsp. i think it is due to global results.

i have implemented like the above code using default-interceptor-ref and global result. is this the right approach that i implemented like above ?


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem in configuring interceptor in struts.xml