JSP JSTL < C: URL > tag: generate URL address tag

Syntax:

Syntax format 1:




Syntax format 2:

Example

<%@page import="java.util.*"%>
  <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <c:set var="time" value="<%=new Date()%>"/>
    <c:url value="http://localhost:8080" var="url" scope="session">
      <c:param name="Hours" value="${time.hours}"/>
      <c:param name="Minutes" value="${time.minutes}"/>
      <c:param name="Seconds" value="${time.seconds}"/>
    </c:url>
    <a href=${url}>用产生的URL路径作为超链接的参数</a>
  %>

http://localhost:8080/?Hours=168&Minutes=21&Seconds=57

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>