Custom JSP taglib. Tag logURI lets you save in session scope the list of visited URI's. Later you will be able to add a special processing if user returns to some of the previous pages. For example you will be able to proceed a Back button hit.
Suppose you have a JSP page start.jsp and this page includes some HTML form that posts data to end.jsp. And you are going to include into start.jsp some special code for execution in case of your user hit Back button on end.jsp. And we assume that start.jsp is not cached.
You can do so:
Of course the ability to proceed returns depends on cache. For static pages the browser itself (on the client side) will service Back button hits for example. Check out here Cache off taglib from Coldtags suite.
In the current release tag logURI keeps info about 10 last visited pages.
Saves the current URI and timestamp in user's session scope. Parameters are: none
Body tag. Executes own body if the request's URI is equal to some of the saved URI's. By default lets you detect that request was originated by Back button hit. Parameters are:
1) depth Optional parameter. Describes an index of historical URI (counting from the last one) to compare with. Default value is 1 (compares the current URI with the previous one, so you will be able to catch Back button hit).
Library: traceuri.jar Description: taglib.tld
© Coldbeans Comments?
See also Coldtags suite - the largest collection of custom JSP tags.