<C: redirect> tag
<C: redirect> tag by automatically rewriting URL to redirect the browser to a new URL, it offers a related URL, and supports c: param tag.
Syntax
<c:redirect url="<string>" context="<string>"/>
Attributes
c: redirect tag has the following attributes:
Attributes | description | If necessary | Defaults |
---|---|---|---|
url | Target URL | Yes | no |
context | Followed by the name of a local network application | no | Current application |
Examples Demo
If you need to <c: import> tag to pass parameters, please use <c: url> tag to create a URL address, as follows:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <html> <head> <title>c:redirect 标签实例</title> </head> <body> <c:redirect url="http://www.w3big.com"/> </body> </html>
Browser opens the page will jump to more than http://www.w3big.com.