前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >请给出JSTL里面的c:url,c:redirect标签例子

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

作者头像
马克java社区
修改2021-07-15 18:00:11
3740
修改2021-07-15 18:00:11
举报
文章被收录于专栏:java大数据

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

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档