我正在使用Struts2.3.28。当我提交它使用submit标签与method
属性的形式,我得到这样的警告:Struts2警告:参数与接受的模式不匹配
WARN com.opensymphony.xwork2.interceptor.ParametersInterceptor
warn- Parameter [method:save] didn't match accepted
pattern [[\w+((\.\w+)|(\[\d+\])|(\(\d+\))|
(\['(\w|[\u4e00-\u9fa5])+'\])|(\('(\w|[\u4e00-\u9fa5])+'\)))*]]!
我struts.enable.DynamicMethodInvocation
设置为true。
我觉得这acceptParamNames
属性为ParametersInterceptor(排序白名单,似乎)在最近的一些版本中加入......该文档只是说(基本上)
“不要碰这个” 。
太棒了!那么,如果我仍然想使用submit
标记的method
属性,我该怎么办?
更多信息:对此我不清楚此警告的含义。如果该模式不匹配白名单(acceptParamNames
)和黑名单(excludeParams
)(ah,一致性),那么应该发生什么?
你确定使用2.3.28吗?您是否修改了接受或排除的模式?无法在我的项目中重现您的问题。 –
也许你需要设置devmode? https://struts.apache.org/docs/devmode.html – leonbloy
[默认排除模式](https://github.com/apache/struts/blob/support-2-3/xwork-core/src/main/ java/com/opensymphony/xwork2/security/DefaultExcludedPatternsChecker.java#L21)排除''方法:''和'isExcluded' [before before](https://github.com/apache/struts/blob/support-2-3/ xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java#L386)'isAccepted'。你有没有修改排除模式? –