This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes interceptor not working in struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "interceptor not working in struts 2" Watch "interceptor not working in struts 2" New topic
Author

interceptor not working in struts 2

vivek mahajan
Greenhorn

Joined: Jun 18, 2009
Posts: 22
I want to have a session interceptor to monitor session, so i have created it as :


and i have configured the interceptor in struts.xml as below :


but the sop of interceptor in not getting printed on server output, even i tried to debug the interceptor but it is not being called. please help.

Thanks in advance
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

It should work there is no problem in configuration.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
vivek mahajan
Greenhorn

Joined: Jun 18, 2009
Posts: 22
But still it is not working
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Make your user defined interceptor stack as default interceptor stack using default-interceptor-ref = "yourinterceptorstackname"

And all the interceptors will be instantiated at startup time by the server observe what's going to happen to your interceptor. (To do this put your log leve in debug)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: interceptor not working in struts 2