There is no problem with arrays (even if it looks like this): this kind of exception means that Struts cannot find the Setter for your parameter:
From the documentation of ParametersInterceptor :
Missing Parameters Warning
If there is no installer for the specified parameter name, a warning message similar to the one below will be written to devMode:
SEVERE: Developer Notification (set struts.devMode to false to disable this message): Unexpected Exception caught setting 'search' on 'class demo.ItemSearchAction: Error setting expression 'search' with value ['search', ] Error setting expression 'search' with value ['search', ] - [unknown location] at com.opensymphony.xwork2.ognl.OgnlValueStack.handleRuntimeException(OgnlValueStack.java:201) at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:178) at com.opensymphony.xwork2.ognl.OgnlValueStack.setParameter(OgnlValueStack.java:152)
Thus, a behavior is expected that allows the developer to detect the missing installer or typo in either the parameter name or the installer.
You can easily reproduce this error by placing an element in the JSP that does not exist in the action.
Since your properties exist (with their installers) in the model, and you use ModelDriven and paramsPrepareParamsStack , I think what happens:
ModelDriven Interceptor delegated to handle the Model object;- The first time
Parameters Interceptor ModelDriven Interceptor did not start yet; - Then your action does not know anything about the model object and will try to find the setters for your parameters in the action, and not in the model.
- Instead, the second interceptor fires after ModelDriven and knows exactly where to set the parameters. This is why the parameters are set correctly in the Action method.
But if so, then you SHOULD NOT get these parameters in the prepare() method (which is why you are using this stack ...):
Please try and post the result here.
The first thing that comes to my mind to solve this problem is to place the ModelDriven Interceptor in front of the first Parameters Interceptor (either copying it or moving it, I'm not sure what side effect, if any, can occur in both cases, you should try again to report it here).
Then define the next stack and use it.
<interceptor-stack name="modelParamsPrepareParamsStack"> <interceptor-ref name="exception"/> <interceptor-ref name="alias"/> <interceptor-ref name="i18n"/> <interceptor-ref name="checkbox"/> <interceptor-ref name="multiselect"/> <interceptor-ref name="modelDriven"/> <interceptor-ref name="params"> <param name="excludeParams">^dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,^parameters\..*,^action:.*,^method:.*</param> </interceptor-ref> <interceptor-ref name="servletConfig"/> <interceptor-ref name="prepare"/> <interceptor-ref name="chain"/> <interceptor-ref name="fileUpload"/> <interceptor-ref name="staticParams"/> <interceptor-ref name="actionMappingParams"/> <interceptor-ref name="params"> <param name="excludeParams">^dojo\..*,^struts\..*,^session\..*,^request\..*,^application\..*,^servlet(Request|Response)\..*,^parameters\..*,^action:.*,^method:.*</param> </interceptor-ref> <interceptor-ref name="conversionError"/> <interceptor-ref name="validation"> <param name="excludeMethods">input,back,cancel,browse</param> </interceptor-ref> <interceptor-ref name="workflow"> <param name="excludeMethods">input,back,cancel,browse</param> </interceptor-ref> </interceptor-stack>
Hope this helps.