You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Navarro, Jose" <Jo...@ideg.es> on 2001/10/25 14:28:56 UTC

JSP - How do I make it invisible to the browser's "back" button?

Hi!

I have developed a JSP page which in turns invokes a servlet used to keep
track of the number of times a certain page in my web is visited.

In other words, when I have a link to some page, I do not link the target
page directly but execute the JSP instead. More or less it goes this way:

<a
href="/hitscounter/counter.jsp?code="thisorthatpage"&destination=http://the/
desired/URL.htm" target="_self">Text of the link</a></p>

(here, "thisorthatpage" stands for an achronim that is stored in my hits
database and that identifies the page being visited).

So when the user clicks on the link, he or she is redirected to the jsp page
which invokes the counter servlet and then redirects the user to the target
(destination) page.

The problem is that the jsp is stored in the browser's list of visited
pages. If then the user wants to go back and clicks on the corresponding
browser's button, the jsp page is executed again and he is redirected one
more time to the same page. The feeling, therefore, is that the back button
doesn't work at all.

Then it would be very interesting to remove the jsp URL from the browser's
access list, so the consequence would be that it would be "invisible" to the
back command. Well, I hope that it is possible to access this list of
visited pages from the jsp code and remove its own entry.

Is this possible? If so, can you tell me how? If not, do you know any other
way to implement it?

Thanks alot for your help!

Regards,

Jose.