📄 navigation.java
字号:
package kmd.commo;import javax.swing.*;import javax.servlet.ServletException;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import java.io.IOException;import java.io.PrintWriter;import java.util.Vector;import java.util.Hashtable;import java.lang.reflect.*;/** * 页面导航 * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2007</p> * <p>Company: 重庆科美达电脑有限公司</p> * @author * @version 1.0 */public class Navigation { public Navigation() { } public void navigator(String strUrl, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0L); PrintWriter out = response.getWriter(); StringBuffer S_Html = new StringBuffer(); S_Html.append("<html>\n"); S_Html.append("<head>\n"); S_Html.append( "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>\n"); S_Html.append("<title> New Document</title>\n"); S_Html.append("</head>\n"); S_Html.append("<script language='JavaScript'>\n"); S_Html.append("window.location.replace('" + strUrl + "');\n"); S_Html.append("</script>\n"); S_Html.append("<body>\n"); S_Html.append("</body>\n"); S_Html.append("</html>\n"); out.print(S_Html.toString()); S_Html = null; out.close(); } public void navigator(int history, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0L); PrintWriter out = response.getWriter(); StringBuffer S_Html = new StringBuffer(); S_Html.append("<html>\n"); S_Html.append("<head>\n"); S_Html.append( "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>\n"); S_Html.append("<title> New Document</title>\n"); S_Html.append("</head>\n"); S_Html.append("<script language='JavaScript'>\n"); S_Html.append("window.history.go(" + history + ");\n"); S_Html.append("</script>\n"); S_Html.append("<body>\n"); S_Html.append("</body>\n"); S_Html.append("</html>\n"); out.print(S_Html.toString()); S_Html = null; out.close(); } public void navigator(String message, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0L); PrintWriter out = response.getWriter(); StringBuffer S_Html = new StringBuffer(); S_Html.append("<html>\n"); S_Html.append("<head>\n"); S_Html.append( "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>\n"); S_Html.append("<title>" + message + "</title>\n"); S_Html.append("</head>\n"); S_Html.append("<script language='JavaScript'>\n"); S_Html.append("window.alert('" + message + "');\n"); S_Html.append("top.location.replace('/EduWest/userLogin.jsp');\n"); S_Html.append("</script>\n"); S_Html.append("<body>\n"); S_Html.append("</body>\n"); S_Html.append("</html>\n"); out.print(S_Html.toString()); S_Html = null; out.close(); } public void navigator(String message, int history, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0L); PrintWriter out = response.getWriter(); StringBuffer S_Html = new StringBuffer(); S_Html.append("<html>\n"); S_Html.append("<head>\n"); S_Html.append( "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>\n"); S_Html.append("<title>" + message + "</title>\n"); S_Html.append("</head>\n"); S_Html.append("<script language='JavaScript'>\n"); S_Html.append("window.alert('" + message + "');\n"); S_Html.append("window.history.go(" + history + ");\n"); S_Html.append("</script>\n"); S_Html.append("<body>\n"); S_Html.append("</body>\n"); S_Html.append("</html>\n"); out.print(S_Html.toString()); S_Html = null; out.close(); } public void navigator(String message, String url, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0L); PrintWriter out = response.getWriter(); StringBuffer S_Html = new StringBuffer(); S_Html.append("<html>\n"); S_Html.append("<head>\n"); S_Html.append( "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>\n"); S_Html.append("<title>" + message + "</title>\n"); S_Html.append("</head>\n"); S_Html.append("<script language='JavaScript'>\n"); S_Html.append("window.alert('" + message + "');\n"); S_Html.append("window.location.replace('" + url + "');\n"); S_Html.append("</script>\n"); S_Html.append("<body>\n"); S_Html.append("</body>\n"); S_Html.append("</html>\n"); out.print(S_Html.toString()); S_Html = null; out.close(); } public void navigator(String message, String targetFrame, String url, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control", "no-cache"); response.setDateHeader("Expires", 0L); PrintWriter out = response.getWriter(); StringBuffer sb = new StringBuffer(); sb.append("<html>\n"); sb.append("<head>\n"); sb.append( "<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>\n"); sb.append("<title>" + message + "</title>\n"); sb.append("</head>\n"); sb.append("<script language='JavaScript'>\n"); sb.append("window.alert('" + message + "');\n"); sb.append(targetFrame + ".location ='" + url + "';\n"); sb.append("</script>\n"); sb.append("<body>\n"); sb.append("</body>\n"); sb.append("</html>\n"); out.print(sb.toString()); sb = null; out.close(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -