Trace URI taglib ver. 1.2

    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.

For example:

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:

a) start.jsp:
 


<%@ taglib uri="taglib.tld" prefix="hit" %>

<!-- save URI -->
 <hit:logURI/>

<!-- proceed Back button hit -->
 <hit:hitBack depth="2">
  ...<!-- include your code -->
 </hit:hitBack>
  ...

a) end.jsp:
 


<%@ taglib uri="taglib.tld" prefix="hit" %>

<!-- save URI -->
 <hit:logURI/>

  ...

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.

Tags are:

logURI

Saves the current URI and timestamp in user's session scope. Parameters are: none

hitBack

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).

for downloading:

Library: traceuri.jar    Description: taglib.tld

© Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.