In this post, you will learn how to use the <c:redirect> tag in the JSTL core tags libarary with example.
You know, the <c:redirect> redirects the browser to a new alternate URL. The <c:param> tag can be used to supply additional request parameters and values if required.
<c:redirect url="<string>" context="<string>"/>
Name | Required | Type | Description |
url | False | java.lang.String | The URL of the resource to redirect the browser to. |
context | False | java.lang.String | Web application context when redirecting to a relative URL of an external resource. |
The below example redirects the browser to Codejava.net website.
<c:redirect url="http://www.codejava.net"/>
Useful to redirect to a new URL altogether. Note that browser will create a new request and performs the redirection.
if | catch | choose | forEach | forTokens | import | out | param | remove | set | url