struts.action.excludePattern is not working for me in Struts 2, i had place servlet cal in form action, form will submit on hyperLink click.
struts.xml:
<constant name="struts.action.excludePattern" value="/PunchoutOrder"/>
web.xml
<servlet>
<description></description>
<display-name>PunchoutOrder</display-name>
<servlet-name>PunchoutOrder</servlet-name>
<servlet-class>com.PunchoutOrder</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>PunchoutOrder</servlet-name>
<url-pattern>/PunchoutOrder</url-pattern>
</servlet-mapping>
jsp:
<form id="form1" name = "form1" method="post" action="PunchoutOrder">
<input type="image" alt="Submit" src="images/submit.png" onclick="Submit(form1);return false;"/>
Getting below Error:
15:26:37,512 WARN [Dispatcher] Could not find action or result
There is no Action mapped for namespace / and action name PunchoutOrder. - [unknown location]
at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61)
at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39)
at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:475)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
Am i missing something………..?
Thank you…..
it seems as if your syntax isn’t entirely correct. I fell upon the same issue and correcting the regular expression worked for me. After adding the line
to my struts.xml, everything works as expected. Request within this path are now returned with 404 errors instead of struts error message “There is no Action mapped for namespace …”
cheers