wood burning stoves 2.0*
The moose likes Servlets and the fly likes Redirecting to the same jsp page 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 » Java » Servlets
Bookmark "Redirecting to the same jsp page" Watch "Redirecting to the same jsp page" New topic
Author

Redirecting to the same jsp page

Ramkumar Subburaj
Ranch Hand

Joined: Sep 07, 2007
Posts: 83
Hello,

I have 10 pages in my application and each page has a log in section.

So when the user tries to log in from any any of these 10 pages, i want to redirect the user to the same page.

is there a way in servlet to find from which jsp page the request comes or what is the best way to do it?


SCJP 1.5, SCWCD 1.4.
Hanging between Web Services and EJB
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60741
    
  65

You're doing it the hard way. Why have a login on each page?

Rather, check for authentication in a servlet filter. If the user is not logged in, record the URL in the session and forward to a single login page. After login, redirect to the stored URL.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Redirecting to the same jsp page
 
Similar Threads
Displaying Buttons on same JSP page after submition of data
help required on access managment of jsp pages
JSP Session and validation
Flushing Output Stream (s2)
session vulnerable pages