I’ve developed a site in struts2, but often, there comes many wrong requests. After 20 or 30 hrs, my server is getting stuck. I want to handle this type of error.
There are given some errors displayed in the server:
1)There is no Action mapped for namespace /operators-in-java/operators-in-java/text and action name javascript. – [unknown location]
………
2)There is no Action mapped for namespace /super-keyword/text and action name javascript. – [unknown location]
3)There is no Action mapped for namespace /operators-in-java/operators-in-java/history-and-features-of-java/text and action name javascript. – [unknown location]
etc.
I’ve performed global exception handling as given below:
<global-results>
<result name="excepHandler">/handler.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="excepHandler"/>
</global-exception-mappings>
But it doesn’t handle, this type of error. Thanx in advance.
Probably the easiest way is to use wild cards. Simply make a action for “*” and have that direct to your error page. All actions with more specific names will override that case so it should be straight forward.