首页 > 其他 > 详细

response对象使用:重定向

时间:2019-10-09 22:25:44      阅读:97      评论:0      收藏:0      [点我收藏+]

index.jsp
index.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8 "
    pageEncoding="UTF-8"%>
  <%@  page import="java.util.*"%> 
<!DOCTYPE html>
<html>
<head>
<title>Insert title here</title>
</head>
<body>
    <%
        response.sendRedirect("index2.jsp")        ;
    %>
</body>
</html>

index2.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

    第二个页面
</body>
</html>
 
运行效果:
 
技术分享图片

 

response对象使用:重定向

原文:https://www.cnblogs.com/wwenwei/p/jsp.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!