JSTL Redirect Tag <c:redirect>

JSTL Redirect tag is used to redirect the request to another resource. The <c:redirect> tag redirects the browser to an alternate URL by providing automatically URL rewriting, it supports context-relative URLs, and it supports the <c:param> tag.

JSTL <c:Redirect> Tag Example:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>JSTL Redirect Tag Example</title>
</head>
<body>
  <c:redirect url="http://www.dineshonjava.com"></c:redirect>
</body>
</html>

As you can see above, JSTL Redirect tag is being used to redirect the request to another resource.

Attributes of JSTL Redirect tag are:

1. url: This attribute provides the URL of the resource to redirect to.

2. context: This attribute provides Name of the context when redirecting to a relative URL resource

that belongs to a foreign context.



<<Previous <<   || Index ||   >>Next >>







No comments:

Post a Comment