This question already has an answer here:
I do not know what configuration changes I may have done to cause this, but for some reason, going to an invalid URL which maps to no struts2 action, only gives a blank page. It does not redirect to the Mapped 404 page, and it does not even display the "There is no Action mapped for namespace [/] and action name []" like it used to. I am trying to get my 404 page working, but I have no clue what is going on here. In my web.xml I have:
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<error-page>
<error-code>404</error-code>
<location>/jsp/error/404.jsp</location>
</error-page>
Have any idea as to why blank pages are being served with invalid URL's and actions? I appreciate the help
Finally - After deep searching about this issue, I'll find a great solution to how get this works as probably!
1st: you need to add the com.opensymphony.xwork2.UnknownHandler bean in your struts.xml:
2nd: setup an action to refer into the page not found behavior.
3rd: in your custom handler you need to define your com.opensymphony.xwork2.config.entities.ActionConfig and check if the action is already exists in your action configuration lists
Keep in mind you need to override the both of methods handleUnknownResult and handleUnknownActionMethod and the both of methods return null.