aspose file tools*
The moose likes Spring and the fly likes Same Spring Controller, different Views Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Same Spring Controller, different Views" Watch "Same Spring Controller, different Views" New topic
Author

Same Spring Controller, different Views

Javier Blazquez
Greenhorn

Joined: Mar 10, 2012
Posts: 2
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

Joined: Feb 05, 2001
Posts: 17259
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Same Spring Controller, different Views