common.jsp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <%@ page import="com.runzhixing.constant.Constant" %>
  3. <%
  4. String path = request.getContextPath();
  5. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  6. %>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  8. <html>
  9. <head>
  10. <base href="<%=basePath%>">
  11. <title>My JSP 'common.jsp' starting page</title>
  12. <meta http-equiv="pragma" content="no-cache">
  13. <meta http-equiv="cache-control" content="no-cache">
  14. <meta http-equiv="expires" content="0">
  15. <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  16. <meta http-equiv="description" content="This is my page">
  17. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  18. <meta http-equiv="X-UA-Compatible" content="IE=10"/>
  19. <!--
  20. <link rel="stylesheet" type="text/css" href="styles.css">
  21. -->
  22. </head>
  23. <body>
  24. <% String un = (String)session.getAttribute(Constant.userName);
  25. if(un==null||un==""){
  26. response.sendRedirect(basePath+"jsp/login/loginType.jsp");
  27. return;
  28. }
  29. %>
  30. </body>
  31. </html>