Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripes: Wrong action class mapping.

Tags:

java

stripes

In Stripes, If there is a wrong action class mapping, the default behaviour of Stripes is that it forwards the control to the same JSP from which the request is made and gives out a complete error stack.

I plan to modify this behaviour and want to give a more user friendly message in case of error.

Said that, Is there a way to redirect to a new page (an error page) in case of wrong action mapping in Stripes?

Thanks.

like image 451
ajc Avatar asked Jul 22 '26 04:07

ajc


2 Answers

You can overwrite the behavior of ActionBeanContext#getSourcePageResolution. You can do what you want there.

like image 87
extendit Avatar answered Jul 23 '26 17:07

extendit


It's been a while since I last set up a Stripes application from scratch, so I don't remember that behavior. Anyway, you can set up error pages the standard way in web.xml:

<error-page>
    <error-code>404</error-code>
    <location>/path/to/page.jsp</location>
<error-page>
like image 21
Frank Pavageau Avatar answered Jul 23 '26 18:07

Frank Pavageau



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!