Core JSTL[c] Mastering the JSP Standard Tag Library

   

JSTL provides four URL actions that let you do the following:

  • Import page-relative resources, context-relative resources, resources that reside in a foreign context, and external resources

  • Redirect HTTP responses

  • Create URLs with automatic URL rewriting and encoded request parameters

The JSTL URL actions are listed in Table 5.1.

Table 5.1. JSTL URL Actions

Action

Description

<c:import>

Imports the content of a URL-based resource

<c:redirect>

Redirects an HTTP response

<c:url>

Creates a URL, applying URL rewriting as necessary

<c:param>

Encodes a request parameter for <c:import>, <c:redirect>, or <c:url>

The actions listed in Table 5.1 are discussed ”in the order in which they are listed ”in the following sections. After we discuss those actions, we examine how they can be used in several real-world scenarios, such as scraping book information from Amazon.com, importing JSP pages from foreign contexts, and redirecting HTTP responses for logging access to external resources.

   

Категории