EDIT 2: if your interceptor can't get the request parameters, I suggest an atomic approach to the problem. Try small steps, resolve problems one by one. In your case, i'll try as follows:
1) Put a debug "hello interceptor" inside your interceptor, to see if the call to your action is actually passing THROUGH your custom interceptor.
If not: check your settings (interceptor, interceptors-stack, packages, actions etc).
If yes:
2) Put a normal variable in the form you are posting in a classic way (not ajax or something, just a <s:hidden name="foo" value="blabla"/>
variable inside your form in the JSP, posted with an <s:submit
button to your action (the actiop mapped for using the interceptor stack with your custom interceptor).
Try to print out the value of that variable from the interceptor.
If variable is null: check your action mappings again, use Firebug Net module to see if the parameters is actually posted out, etc.
If variable is read:
then the problem is in the variable of the JQGrid, check the way you are referencing it in the JSP and what is going out of the page with Firebug again.
Etc...
I suggest you to use a new JSP with only your stuff inside, with a new action for displaying and receiving the result, with an empty execute()... just a very very tiny skeleton to test your code being sure nothing external is messing up the worflow...
EDIT: your Interceptors configuration seems fine (except for defaultStack
instead of default-stack
, but I'm pretty sure it's the same).
Are all of your Actions inside the same <package>
in which the <interceptors>
is defined ?
Why on the Interceptor and not in the Action ? How do you need to handle that data ?
By the way, this is the code:
public String intercept(ActionInvocation invocation) throws Exception {
final ActionContext context = invocation.getInvocationContext();
HttpServletRequest request = (HttpServletRequest) context.get(StrutsStatics.HTTP_REQUEST);
String gridName = (String) request.getParameter("gridName");
/* do something */
return invocation.invoke();
}