Name

<c:redirect>

Synopsis

The <c:redirect> action sends a redirect response to the client, telling it to make a new request for the specified resource. Internal and external resources can be specified in the same ways as for <c:url>, and the URL and parameters specified by nested <c:param> actions are also converted in the same way, if needed.

Syntax 1: Without a body

<c:redirect url="url" [context="externalContextPath"] />

Syntax 1: With a body

<c:redirect url="url" [context="externalContextPath"]>
  <c:param> actions
</c:redirect>

Attributes

Attributename

Java type

Dynamic valueaccepted

Description

value
String

Yes

A page- or context-relative path, or an absolute URL.

context
String

Yes

The context-path for an external application in the same container, starting with a slash.

Example

<c:redirect url="result.jsp" />

Get JavaServer Pages, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.