response.sendRedirect("http://www.foo.com/path/error.html"); |
<% response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY); String newLocn = "/newpath/index.html"; response.setHeader("Location",newLocn); %> |
?。糺sp:forward page="/newpage.jsp" /> |
<jsp:useBean id="globals" scope="application" class="com.xxx.GlobalBean"/> |
<%@ page import="Java.util.*, Java.text.*" %> <HTML> <HEAD> <TITLE>JSP to display the current time</TITLE> </HEAD> <BODY> The current time is: <% Date now = new Date(); out.println(DateFormat.getTimeInstance().format(now)); %> </BODY> </HTML> |
<%@ page import="Java.io.*" %> <%! String Mkdir(String path) { String msg=null; 聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com Jsp如何實現(xiàn)網(wǎng)頁的重定向_MySQLJsp如何實現(xiàn)網(wǎng)頁的重定向_MySQL: 1.可以使用: response.sendRedirect(http://www.foo.com/path/error.html); 2.可以手工修改HTTP header的Location屬性,如下:<% response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY)
推薦度:
最新推薦猜你喜歡熱門推薦 |