0

I'm new to Spring3 MVC and I'm working on a web project using it, I has implemented login and logout. I put the user info in session when user login and remove it when he logout.

Now I want to implement that:

if user login, thus he can do whatever, but if he logout and access the page which is in the server, we should redirect to the login page.

I think it's possibly using filter and some configuration in web.xml so I needn't writte much code. I think it's very easy using configuration but I don't know how to implement it.

SO How and What should I config? It's like this question a bit:Looking for a Simple Spring security example

Thanks for your help.

Community
  • 1
  • 1
hongchangfirst
  • 245
  • 3
  • 17
  • In short you need FORM-BASED authentication and access-control, right ? Start with spring-security(http://static.springsource.org/spring-security/site/start-here.html) – Ahamed Mustafa M Jun 28 '12 at 04:16
  • Related and it might throw some light: http://loianegroner.com/2010/01/spring-security-login-and-logout-form-jsp/ – 18bytes Jun 28 '12 at 04:17
  • I have already searched a lot of materials, I think there's something can work but too complicated, If there's a simple one, Can you tell me how to do it? – hongchangfirst Jun 28 '12 at 07:44

1 Answers1

1

use -
return "redirect:LoginPage";

java2468
  • 21
  • 2