0

I have different mappings that start with \mobile or contain \mobile. Is there a way to catch all these mappings?

My Mappings are:

\mobile\login.mvc

\mobile\profile\details.mvc

\secure\mobile\profile\edit.mvc

Now I want that for all "\mobile" mappings one function oder mapping is called, and then the call mapping.

Background: I want to check with every call, whether the user is logged in and sign him if necessary. But I would not query at every mapping the parameters username and password but all in one place.

Aniket Kulkarni
  • 12,825
  • 9
  • 67
  • 90
Roy
  • 11
  • 2

1 Answers1

0

If you want to authenticate user in every controller then Spring AOP will be a good choice. You can write a single authentication method and invoke it before controller using AOP.
This might help http://tedone.typepad.com/blog/2011/05/using-aop-easily-with-aspectj-and-spring.html

Ajinkya
  • 22,324
  • 33
  • 110
  • 161