相关文章推荐
叛逆的墨镜  ·  IntelliJ IDEA + Maven ...·  1 周前    · 
果断的可乐  ·  CheckBox 类 ...·  1 年前    · 
备案 控制台
学习
实践
活动
专区
工具
TVP
写文章
专栏首页 java大数据 请给出JSTL里面的c:url,c:redirect标签例子
1 0

海报分享

请给出JSTL里面的c:url,c:redirect标签例子

6)c:url,c:redirect标签

完成类似Servlet的sendRedirect的功能:

例 2.2.6

<%@ page contentType="text/html; charset=GBK"%>

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

<html>

<body>

主页面

<!--var identify the value, destination is equal to hello.jsp?name=mark-to-win-->

<c:url value="hello.jsp" var="destination">

<c:param name="name" value="mark-to-win" />

</c:url>

<c:redirect url="${destination}" />

</body>

</html>

hello.jsp:

<%@ page contentType="text/html; charset=GBK" %>

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

<br>

被包的页面

<c:out value="被import的html"/>

<c:out value="${param.name}"/>

<br>

更多请看: https://blog.csdn.net/qq_44594371/article/details/103185964

本文转载自: https://blog.csdn.net/qq_44594371/article/details/103185964 复制
如有侵权,请联系 cloudcommunity@tencent.com 删除。