Name

<c:import>

Synopsis

The <c:import> action imports the content of an external or internal (same web application) resource. An external resource can be either a resource owned by a different application in the same web container or a resource on a different server that can be accessed through one of the protocols supported by the web container (e.g., HTTP or FTP).

When importing an internal resource, the behavior is the same as for the <jsp:include> standard action; the target resource has access to the same request parameters and the same request, session, and application scope variables as the originating page. A target resource owned by a different application in the same web container has access only to the same request parameters and request scope data, and a resource owned by a different server has access only to the request parameters specified as a query string or nested <c:param> actions.

An internal resource can be identified by a context- or page-relative path. An external resource owned by another application in the same container must be identified by a context-relative path plus the context-path for the application. For resources owned by an external server, an absolute URL with a scheme (protocol), server name, and resource identifier must be used.

The character encoding for the imported content can be specified for cases in which it can’t be determined through other means (e.g., HTTP headers). This is typically needed only for resources imported using a protocol ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.