Intercepting request transactions
The previous chapter ended up with a recipe that used HandlerInterceptor
and HandlerInterceptorAdapter
as the mediums for handling incoming and outgoing request attributes and session data of any request handler in a @Controller
, for security and transaction management purposes. This recipe will provide another option for how to mimic the functionality of these two Spring MVC API classes.
Getting started
Open the same project, ch05
, and add a @Controller
that will implement requests and responses for our employee login and menu transactions.
How to do it...
Aside from JEE Filter implementation, let us use aspect to intercept some request-response transactions:
- Aside from implementing
Filter
, one obvious solution to monitor sessions during pre and post login transactions is to create interceptors. In the packageorg.packt.aop.transaction.controller
, create aLoginController
that will provide a login form and an employee list results page:
@Controller public class...