Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

tag

tag

JSP Standard Label LibraryJSP Standard Tag Library

The tag provides all the functionality of thejsp:includeaction tag, and also allows including absolute URLs.

For example, using thetag can include web page content from a different FTP server.

Syntax format





property

The tag has the following attributes:

property Description Whether it is required Default value
url The URL of the resource to import, which can be a relative or absolute path, and resources from other hosts can also be imported Is None
context When accessing an external context resource using a relative path, context specifies the name of that resource. No The current application
charEncoding The character encoding of the imported data No ISO-8859-1
var The variable used to store the imported text No None
scope The scope of the var attribute No page
varReader An optional variable for providing a java.io.Reader object No None

Example Demonstration



<%@ page language="java" contentType="text/html; charset=UTF-8"

    pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>





c:import 标签实例













The above program will print the source code of the http://www.runoob.com" page; you can try it yourself.


JSP Standard Label LibraryJSP Standard Tag Library