This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
In my struts 2 application I have a LoginInterceptor I want to pass some parameter through the struts.xml file How can I pass the parameter to the interceptor. In other words I want the parameter which I send to the action from struts.xml
I want menuId in interception which I have configure for this action.
How do I get the value In interceptor.
I have already try for getter setter for menuId in interceptor.
I think these parameters will get places into the request and can be retrieved from there. Also, if you make bean properties for these values in your action class I think they will be placed into the action class as well.
Joined: Oct 30, 2008
I am getting value in action class by getter and setter but I want the value in Interceptor
Your intercept method should recieve a parameter of type ActionInvocation. If you call .getAction on this object you can get a reference to your action class and then you can get the values from there.