tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristina Öhgren <kristina.ohg...@mind.com>
Subject RE: jsp:forward problem
Date Tue, 16 May 2000 09:01:01 GMT
Thank you for all help, but it still doesn't work. The forwarded request now
contains an empty user-name, an empty password, and a check parameter that
contains a value. When I reload the page, somehow the check parameter is set
to null, and user_name and password is re-set again.
Below is cut from login.jsp. 'login' is the bean containing a Login method.
It returns a string containing user type. Can anyone see anything?

I would be very grateful for any help!
Regards, Kristina Ohgren

<%
...
	try{
		check = request.getParameter("check");
		check.length();
	}
	catch(NullPointerException e)
	{
		check = "";
	}
	if(check.equals("")){
		if((request.getParameter("USER")).equals("")){
%>
			<jsp:forward page="reLogin.jsp" />
<%	
		}
		s = login.Login(request);
%>
		<jsp:forward page="login.jsp">
			<jsp:param name="USER" value="" />
			<jsp:param name="PASS" value="" />
			<jsp:param name="check" value="<%=s%>" />
		</jsp:forward>
<%	
	}
	else{
		...
	}
%>



-----Original Message-----
From: James House [mailto:james.house@partnet.com]
Sent: den 15 maj 2000 19:05
To: tomcat-user@jakarta.apache.org
Subject: Re: jsp:forward problem



To work around similar problems, we use the following:

Receive request, process it, and (before drawing the page for the
user) redirect back to the very same URL, but strip off all of the
request parameters before doing so (then the url won't get the
parameters that make it perform the "command") - another idea
would be to redirect back with an extra parameter that means
"don't process this request, only draw the page".

When the user backs up from the next page, the browser will have
remembered the URL that it was redirected to (the one without the
parameters telling that URL to do something), so everything is fine.

Of course, you then have to write your pages so that they work in
some default way (i.e. just do some drawing) if the parameters that
it can accept are not present....

Hope this helps,
James

>Hello!
>
>I am desperate to find a solution to the following:
>
>I use a .jsp-page with a login-form. The request is sent to login.jsp that
>uses a bean to check user against database and return user-type (user or
>admin). Login.jsp then forwards to a start-page depending on the user type.
>If I logout from this start page and then use "back" and "reload" in the
>browser, the user gets re-logged in (because the whole request is re-sent).
>This is obviously not acceptable. Does anyone know what I need to do to
>avoid this?
>
>I know that this is not a question for this list, but I thought there might
>be a saving soul out there? If you know another, better, list for this,
that
>would also be helpful.
>
>Big thanks in advance
>Kristina Ohgren
>
>--------------------------------------------------------------------------
>To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commmands, email: tomcat-user-help@jakarta.apache.org


--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org

Mime
View raw message