on ‎2019 Jul 16 3:50 PM
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>
Request clarification before answering.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.