JSTL c:redirectで指定したURLへリダイレクトさせるサンプル

構文
書式1
<c:redirect url="" />
書式2
<c:redirect url="">
<c:param name="" value="" />
</c:redirect>
<c:param> タグを使って、URLにリクエストパラメータを指定します。
属性
<c:redirect> タグには次の属性を指定します
context コンテキストパスを指定します。
url リダイレクト先のURLを指定する。必須属性で、省略できない。

使用例1

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<c:redirect url="https://sample.com/" />
<c:redirect url="https://sample.com/" />
<c:redirect url="https://sample.com/" />

使用例2

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<c:redirect url="https://arkgame.com/">
<c:param name="city" value="oosaka" />
</c:redirect>
<c:redirect url="https://arkgame.com/"> <c:param name="city" value="oosaka" /> </c:redirect>
<c:redirect url="https://arkgame.com/">
     <c:param name="city" value="oosaka" />
</c:redirect>

 

JSTL

Posted by arkgame