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.
posted 11 years ago
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.