tag
This tag automatically rewrites URLs when needed.
The var attribute is used to store the formatted URL.
Syntax format
property
| property | Description | Whether it is required | Default value |
|---|---|---|---|
| value | The base URL | Is | None |
| context | The name of the local web application | No | The current application |
| var | The name of the variable representing the URL | No | Print to page |
| scope | The scope of the var attribute | No | Page |
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:url 标签实例
实例 Demo
">
这个链接通过 标签生成。
Access the above page through a browser, then view the source code, which is displayed as follows:

JSP Standard Tag Library