I'm developing a web server using MVC with multiActionController. However, now I want to handle any request (/*) with a Front Controller. After that, this Front Controller will forward this request to the View in ModelAndView. However, after many searches with Google, I still don't know how to implement it. I appreciate your help.
Asked
Active
Viewed 1,777 times
0
-
Spring MVC's DispatcherServlet *is* the front controller. It dispatches to the appropriate controller, which dispatches to the appropriate view. – JB Nizet May 25 '12 at 05:30
-
Yes JB Nizet, I know that. However, I don't know how to handle at this front controller. For example: every request send to my 3 controllers have to check session 3 times, so now I want to check at front controller just 1 time before continue process afterward. Thanks. – Viet.Hoang.Le May 25 '12 at 05:38
-
Explain what you mean with "every request send to my 3 controllers have to check session 3 times" (with code, if possible), because it's not clear (at least to me). – JB Nizet May 25 '12 at 06:58
1 Answers
0
In that case you need to have a controller class defined with the annotation @RequestMapping("/") and one function which will catch the GET request for the same mapping and from that function you can return whatever model and view you want to return.
Hope this helps you.
Cheers.

Japan Trivedi
- 4,445
- 2
- 23
- 44