struts2 no longer accepts http map parameters?

╄→尐↘猪︶ㄣ 提交于 2019-12-01 05:45:25

It turns out that they hardened restrictions on parameter names to boost 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>

(I had "s and /s in my parameter names) File upload ceased working after that (interceptor stacks are madness), so I had to add it explicity either.

Update: These days I strongly suggest using JSON to pass complex structures instead of rich OGNL forms. Of course you would need some JS.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!