cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Need to divide return custom 500 error page depending of some method result.

Former Member
0 Likes
495

Have code like this. If we have some exception or 400, 405, 500 error code, we will be redirected to one page. But now we need to send user to one page or another, depending on spesial method result. Was trying several aproaches: 1 Setting in web xml not html page but url, and controller that will hold logic to choose page. But hybris needs cmsSite and session to show page. And after redirecting to controller we loose this information. 2 Using @ExceptionHandler method. But this approach helps not fully. We could hold exceptions but we cant hold error codes like 500.

The question is hot to hold errors codes in java code to divide returned pages?

     <exception-type>java.lang.Throwable</exception-type>
     <location>error.html</location>
 </error-page>
 <error-page>
     <error-code>400</error-code>
     <location>error.html</location>
 </error-page>
 <error-page>
     <error-code>405</error-code>
     <location>error.html</location>
 </error-page>
 <error-page>
     <error-code>500</error-code>
     <location>error.html</location>
 </error-page>

Accepted Solutions (0)

Answers (0)