Hi All,
I have this strange problem. It's description is somewhat long, so
please bear with me.
I have an application on Apache + Tomcat where the first page that comes
up is a html file having a jsp in one frame. This jsp is the password
validation jsp where the user is prompted for an user id and password.
This jsp submits to a login servlet where at first a session is created
for the user. It then validates the password and puts the result of
password validation, true or false, into the session. If the result is
false, it then uses a sendRedirect to the original html page. The login
jsp in the frame of this html then retrieves the result from password
validation and prompts the user for password again, with the message at
the bottom that password is invalid. 
The problem is, say the user enters the wrong password for the first
time. The html comes up but the message is not printed at the bottom. He
then again enters a wrong password. The message now comes up.
To find out what is happening, I printed the session address in both the
servlet and the jsp. I found that the first time the wrong password is
entered, the result is put by the servlet in a session which is
different from what the jsp retrieves it from. But the second time both
the sessions are the same. Why is this happening? Below is the tomcat
console.

Starting tomcat. Check logs/tomcat.log for error messages
2001-07-12 04:16:24 - ContextManager: Adding context Ctx(  )
2001-07-12 04:16:24 - ContextManager: Adding context Ctx( /test )
2001-07-12 04:16:25 - PoolTcpConnector: Starting HttpConnectionHandler
on 8080
2001-07-12 04:16:25 - PoolTcpConnector: Starting Ajp12ConnectionHandler
on 8007
objSessionorg.apache.tomcat.session.StandardSession@749757
----------------------> Printed in Jsp,first time page comes up
PasswordValidationinJSPnull------>Result of password validation,
correctly null the first time
Minimum 1 At present 1
COnnections Pool 1
COnnections Pool 1
objSessionorg.apache.tomcat.session.StandardSession@91cee --->After
wrong password, printed in login servlet
objSessionorg.apache.tomcat.session.StandardSession@1173ef---->Printed
in jsp, session is different
PasswordValidationinJSPnull-------->Result of password validation,
should have been false
Minimum 1 At present 1
Minimum 1 At present 1
Minimum 1 At present 1
Minimum 1 At present 1
COnnections Pool 1
COnnections Pool 1
objSessionorg.apache.tomcat.session.StandardSession@74c3aa--->Again
wrong password, printed in servlet
objSessionorg.apache.tomcat.session.StandardSession@74c3aa--->Printed in
jsp, now the sessions are the same
PasswordValidationinJSPfalse------->Result of password validation,
correct as put in servlet 
Minimum 1 At present 1
Minimum 1 At present 1

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to