tag
For example, using the
Syntax format
property
| 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 Tag Library