404 for no action mapping in struts

Normally we got 404 errors in web application and in struts the requested page which is not having mapping in config file, we can specify a default mapping to action with below code:

<action
name=”/error404″
unknown=”true”
forward=”/Error404.jsp/>

“Unknown” attribute should be defined as true in case you wish to redirect the request to given page in forward attribute.

This is the way you can handle a no mapping action error in struts.