I want to catch the exception thrown when I loose my session, not only because a session timeout (for reports for example).
Also I want that this handler will handle only that specific exception and will not be a global exceptions handler or any thing like this.
Basically, I want to catch exception org.springframework.web.HttpSessionRequiredException
.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
With any of the proposed solutions below you should be able to handle the exceptions and perform logic on them.
Possible Solutions:
1. You can add a FlowExecutionListenerAdapter that will listen to all exceptions thrown and then you can filter by instanceof.
and you need to add it in your webflow executor config:
2. Another solution is to implement your own FlowExecutionExceptionHandler. Although it will be a global exception handler The method
will allow you to have access to the context which will allow you to filter on many different variables. See also, How implement the interface FlowExecutionExceptionHandler
3. Another possible solution if you are using Spring Security project I believe Spring security will handle the exception for you automatically if you have the follow config:
and if you want to catch the exception and perform logic on it see the following answer: Logout/Session timeout catching with spring security
I would recommend the 3rd solution as it is the least intrusive. In the 3rd solution's link there are several really elegent solutions to handling sessions.