Struts2 no longer accept http map parameters?

In struts2, I used the built-in OGNL in struts2, naming my inputs as <input name='bag["item"].property'> Which got into getters / setters getBag().get("item").setProperty(value) I upgraded to struts 2.2.1, and suddently they no longer work: getter never gets called.

The Internet does not say anything about using OGNL in parameters, as if no one ever made complex forms.

How to return my map settings?

+5
source share
1 answer

It turns out that they have tightened restrictions on parameter names in order to increase security.

So I had to add to my struts.xml:

       <interceptor-stack name="defaultStack">
          <interceptor-ref name="params">
             <!-- For maps to work -->
             <param name="acceptParamNames">
                 [a-zA-Z0-9\.\]\[\(\)_'\s"/]+
             </param>
          </interceptor-ref>
       </interceptor-stack>

( s /s ) ( - ), .

. JSON OGNL. , JS.

+3

All Articles