You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ralph Merrick <ja...@yahoo.com> on 2002/10/01 23:39:55 UTC

Cache question

Hello all. Cache question. I have a jsp form that is
being forward from a login page that is doing
validation from a database. The jsp form has buttons
and a click on each specific button will set a hidden
input a specific value and and the action will go to
another jsp page, where depending on what the hidden
input was set to , will jsp forward to the page that
is requested. But on click a javascript back, <INPUT
TYPE="button" VALUE="Cancel"
onClick="javascript:history.go(-1)">or the browser
back button we get the previous page, but a click on
any different button will go to the page you were just
at, not the page it should go to. I have http 1.1
configured on my tomcat and I know that if on the page
where the buttons reside, I add this :
<%
//HTTP 1.1
    response.setHeader("Cache-Control","no-cache");
//HTTP 1.0
    //response.setHeader("Pragma","no-cache");
//prevents caching at the proxy server
    //response.setDateHeader ("Expires", 0);%>
Then if I click on let say button a to go to a.jsp and
click back , I get this:
'Warning: Page has Expired The page you requested was
created using information you submitted in a form.
This page is no longer available. As a security
precaution, Internet Explorer does not automatically
resubmit your information for you. 
To resubmit your information and view this Web page,
click the Refresh button. '
Is there any way to just to see the previous page and
have it have, now lets say a click on button b to go
to b.jsp and not to the cached a.jsp
Thanks 





__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Cache question

Posted by "Noel J. Bergman" <no...@devtech.com>.
> I have a jsp form that is being forward from a login page
> that is doing validation from a database.

> Is there any way to just to see the previous page

As I understand it, you have a JSP page that isn't to be seen until the user
logs in, so you forward the request to a login page.  You want to know how
to get back to the original page.

I have done this by simply sending a refresh:

		String destPage = request.getParameter("destPage");
		String refresh = "0" + ((destPage != null) ? "; URL=" + destPage : "");
		response.setHeader("Refresh", refresh);

That tells the user-agent to reload the page, and this time my code would
know that the user is logged in, and thus doesn't need to forward the user
to the login page.

These days, another way to handle login is with a filter, and that changes
the picture.  But the solution I'm using above should fit into your existing
scheme.

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>