• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Same Spring Controller, different Views

 
Javier Blazquez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm developing a web site in which you can login from almost every page. The login action is the same to every page but always it must return to the page from which the action has been launched. My idea is to manage all the login request with the same controller (make it reusable) and depends on the page that called it, forward to it.

I don't know if it is possible or if there is another way to accomplish my requirements without having to "copy" the same action on each controller.

Thanks.
JB.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you can just use Spring Security and it does that automatically. So if you try to go to a URL you have secured, and you aren't logged in it will automatically send you to the login and redirect you to the page that was originally requested.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic