Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OGNL exceptions setting Struts2 checkbox value

Tags:

struts2

After adding a s:checkbox to my form, I get OGNL errors in the ParamsInterceptor:

WARN  [OgnlValueStack] Error setting expression '__checkbox_filter.findRejected' with value '[Ljava.lang.String;@dc926f'
ognl.OgnlException: target is null for setProperty(null, "findRejected", [Ljava.lang.String;@dc926f)

I am aware that the extra hidden field with underscores in its name (__checkbox_filter.findRejected) was correctly added by Struts2.

I don't understand, however, why the ParametersInterceptor is trying to set this property, that was added by Struts2, on my Action (which obviously doesn't contain a '__checkbox_filter' property).

It is normal to see this OGNL error coming from with Struts2 checkboxes? How can I avoid it?

like image 348
jjmontes Avatar asked Mar 07 '26 14:03

jjmontes


1 Answers

I've just stumble across the very same problem.

You need to place the Checkbox Interceptor BEFORE the Parameters Interceptor in your interceptor stack.

This is the case by default, so I guess that you're using a custom stack...

like image 72
mtlx Avatar answered Mar 10 '26 13:03

mtlx