Jsp-jstl-core-redirect-tag
提供:Dev Guides
JSTL-コア<c:redirect>タグ
*<c:redirect>* タグは、自動URL書き換えを促進することにより、ブラウザーを代替URLにリダイレクトし、コンテキスト相対URLをサポートし、 *<c:param>* タグもサポートします。
属性
*<c:redirect>* タグには次の属性があります-
Attribute | Description | Required | Default |
---|---|---|---|
url | URL to redirect the user’s browser to | Yes | None |
context | /followed by the name of a local web application | No | Current application |
例
パラメータを <c:import> タグに渡す必要がある場合は、以下に示すように、最初に <c:url> タグを使用してURLを作成します-
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
<html>
<head>
<title><c:redirect> Tag Example</title>
</head>
<body>
<c:redirect url = "http://www.photofuntoos.com"/>
</body>
</html>
上記のコードは、リクエストを* http://www.photofuntoos.com*にリダイレクトします-自分で試してください。