Redirect taglib ver. 1.7

    Custom JSP tag. Tag Redirect redirects control to the specified page. Tag can produce URL encoding for sessions support. One parameter to sets the target page. Also this taglib clears JSP writer's buffer before the redirection. For example:
 

<%@ taglib uri="taglib.tld" prefix="send" %>
<html>
...
<send:Redirect to="http://your_server.com/new_page.jsp" />
...
</html>

Tag setParameter lets you define a GET parameter for the request (value will be encoded automatically):
 


<%@ taglib uri="taglib.tld" prefix="send" %>
<html>
...
<send:Redirect to="http://www.server.com/nextpage.htm">
 <send:setParameter name="A">value for A</send:setParameter>
 <send:setParameter name="B">value for B</send:setParameter>
</send:Redirect>
...
</html>

Tags are:

Redirect

Redirects request to the given URL. Parameters are:

1) to Describes a target URL
2) encode Optional parameter. Describes an URL encoding (rewriting) policy. Possible values are true or false. If this value is false tag uses target URL "as is". Otherwise session ID will be encoded. Default value is true (encode URL).
3) cond Optional parameter. Describes a boolean expression this redirection depends on. Default value is true (perform the redirection).
4) after Optional parameter. Describes a time value (java.util.Date). Any request after that time should be redirected

setParameter

Body tag defines a GET parameter for the URL. Parameters are:

1) name Describes a name for your parameter
2) cond Optional parameter. Describes a boolean expression tag's behavior depends on. Default value is true (set parameter).

for downloading:

 Library: redirtag.jar     Description: taglib.tld

 © Coldbeans      Comments?

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

     

Also in Coldtags: