tobbs.jsp 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <%@ page language="java" pageEncoding="utf-8"%>
  2. <%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
  3. <%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
  4. <%
  5. String path = request.getContextPath();
  6. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  7. %>
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  12. <title>Insert title here</title>
  13. <script type="text/javascript">
  14. var url = getUrlParam('url');
  15. </script>
  16. </head>
  17. <body>
  18. <%
  19. String username=session.getAttribute("em_code").toString();
  20. String url=request.getParameter("url");
  21. if(url.length()==0){
  22. url="/JF";
  23. }
  24. Cookie cookie = new Cookie("jforumSSOCookieNameUser",username);// 保存用户名到Cookie
  25. cookie.setPath("/");
  26. //String host = request.getServerName();//本地测试时注释掉的代码
  27. //cookie.setDomain(host);//本地测试时需注释掉的代码
  28. cookie.setMaxAge(-1);
  29. response.addCookie(cookie);
  30. System.out.println(url);
  31. response.sendRedirect(url);//跳转到jforum论坛,看看是否登录了
  32. %>
  33. </body>
  34. </html>