I am a little crazy about this. At first, my mapping is like below

"500"(view:'/error/exception')

But, then we found, if the exception is throw in Spring Security code, the error page is not correct. By looking the source code, I change the mapping from view to action

"500"(controller: "error", action: "exception")

and, in the action I will send a redirect request to another action which will render view. Seems everything work.

However, today I found if the request which cause exception is GET, it works, if it is a POST, then nothing rendered, it just return 404 to browser.

Could anybody tell me how to walkaround it?

有帮助吗?

解决方案

Found a walkaround. Config mapping as:

"500"(view:'/error/exception')

In the view, write an redirect

<% response.sendRedirect("/xxx/error/exception") %>

Then , render view in the ErrorControl, exception action.

Waiting for better solution.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top