[ https://issues.apache.org/jira/browse/WW-5238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17611696#comment-17611696 ]
Daniel Wu commented on WW-5238: ------------------------------- After more investigation, I found out that the cause of the _'Method prompt for action aSbmt1 is not allowed!'_ might not be SMI related. When checking the HTML source code, I found out that the HTML form was generated incorrectly. For example, in the JSP file, the form is defined as the followings. _<s:form namespace="/apath" autocomplete="off">_ _<s:submit action="aSbmt1" .../>_ _<s:submit action="cancel" .../>_ _</s:form>_ However, the generated HTML code shows that the HTML form has an inserted default action, which will invoke the _prompt_ method. This is definitely wrong mapping. _<form {color:#FF0000}id="aSlct" name="aSlct"{color} *{color:#FF0000}action="apath/aSlct.action"{color}* {color:#FF0000}method="post"{color} autocomplete="off">_ We use Tiles. The aSlct action is defined as the following in the menu. _<s:url ... namespace="/apath" action="aSlct" />_ *It could be the wrong context or wrong mapping used in processing the <s:form> tag in the Struts 2 version 6.0.3.* > Strict Method Invocation (SMI) too strict? > ------------------------------------------ > > Key: WW-5238 > URL: https://issues.apache.org/jira/browse/WW-5238 > Project: Struts 2 > Issue Type: Bug > Components: Core > Affects Versions: 6.0.3 > Reporter: Daniel Wu > Priority: Critical > > Got the following error (Error No. 2) when trying to create one record. The > prompt method is not supposed to be invoked for aSbmt1. Before that, the > aSbmt1 was not accepted (Error No. 1). I tried several ways to try to > overwrite the regular expression without success. Was something strange > introduced into the Struts 2 version 6.0.3? Is Strict Method Invocation (SMI) > in a dead loop? I am surprised at that there is no issue reported for the > Struts 2 version 6.0.3 yet. > 1. com.opensymphony.xwork2.interceptor.ParametersInterceptor - > *{color:#ff0000}Parameter [action:aSbmt1] didn't match accepted > pattern{color}* > [[\w+((\.\w+)|(\[\d+])|((\d+))|(['(\w-?|[\u4e00-\u9fa5]{-}?){+}'])|(('(\w{+}{-}?|[\u4e00-\u9fa5]-?)')))*]]! > See Accepted / Excluded patterns at > [https://struts.apache.org/security/#accepted--excluded-patterns] > *{color:#ff0000}2. com.opensymphony.xwork2.config.ConfigurationException: > Method prompt for action aSbmt1 is not allowed!{color}* > at > com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:191) > ~[struts2-core-6.0.3.jar:6.0.3] > at > org.apache.struts2.factory.StrutsActionProxy.prepare(StrutsActionProxy.java:57) > ~[struts2-core-6.0.3.jar:6.0.3] > at > org.apache.struts2.factory.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:32) > ~[struts2-core-6.0.3.jar:6.0.3] > at > com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:60) > ~[struts2-core-6.0.3.jar:6.0.3] > at > org.apache.struts2.dispatcher.Dispatcher.createActionProxy(Dispatcher.java:673) > ~[struts2-core-6.0.3.jar:6.0.3] > at > org.apache.struts2.dispatcher.Dispatcher.prepareActionProxy(Dispatcher.java:658) > ~[struts2-core-6.0.3.jar:6.0.3] > at > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:621) > ~[struts2-core-6.0.3.jar:6.0.3] > at > org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79) > ~[struts2-core-6.0.3.jar:6.0.3] > at > org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:140) > ~[struts2-core-6.0.3.jar:6.0.3] > at > weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78) ~ -- This message was sent by Atlassian Jira (v8.20.10#820010)