Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Spring and the fly likes Redirect to Login page if Request is null. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Redirect to Login page if Request is null." Watch "Redirect to Login page if Request is null." New topic
Author

Redirect to Login page if Request is null.

Prashant Chindhade
Ranch Hand

Joined: Jan 19, 2011
Posts: 77
I have basic application.which has following line of execution.

1)Login Page
2)if user name and password is correct than redirect to Home page. else
3)redirect to Login page.

now i want to do that.

if user directly goes to Home by any mean he/she should be redirected to login page.

currently if i go directly to Home it is showing Request paremeter as null and can not process request. so what kind of authentication should I provide at controller end.

This is controller code.


error i am getting.


Thanks in advance for your help.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

All that can be handled with Spring Security. I would look at the SpringFramework documentation and see how to set up and use Spring Security.

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: Redirect to Login page if Request is null.
 
Similar Threads
how to disable submit button in jsp based on the login credentials?
Redirection after realm authentication
JSF Filter prevent direct access certain page
Re-directing to the correct page - Grails
Confused - MVC, JSP, Servlet interaction