This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Form Login Refresh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Form Login Refresh " Watch "Form Login Refresh " New topic

Form Login Refresh

Ezeilo Uchenna

Joined: Jan 10, 2002
Posts: 5
Hi All,
I am using form login authentication method to protect a page ,PayAccount. The problem is that when a user successfully logs in and is able to access the PayAccount page if he/she presses the browser back button the form-login-page is presented again to the user and on submitting correct login information the following Tomcat error message is displayed
Apache Tomcat/4.0.4 - HTTP Status 404 - /j_security_check
type Status report
message /j_security_check
description The requested resource (/j_security_check) is not available.
Another error occurs when a user refreshes the PayAccount page. It shows a blank page. Clicking on the browser back button gives the same error as the first error.
I want to know is this the expected behaviour for a protected page when you configure form based authentication using your servlet container like Tomcat or am I making a mistake somewhere.
Please help.

_ _____________ _ <p><br />scjp, scwcd<br />_ _____________ _
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Did you want to make the login page more intelligent so that if they are already logged in it redirects them to the index page?
With the the second error, what is the URL in the address bar? Is it the URL for the j_security_check or the PayAccount page?
Ezeilo Uchenna

Joined: Jan 10, 2002
Posts: 5
Yes I want to make the URL more intelligent but it is supposed to send the user to the protected PayAccount (the next page the user expects) when they have logged in before. If the user has logged in
No, when a user refreshes the PayAccount page after a successful login he/she gets a blank page with the URL of PayAccount still showing in the browser's address bar.
[ November 22, 2002: Message edited by: Ezeilo Uchenna ]
I agree. Here's the link:
subject: Form Login Refresh
jQuery in Action, 3rd edition