main.jsp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
  2. <%
  3. String path = request.getContextPath();
  4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  5. String loginName = request.getParameter("loginName");
  6. %>
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  8. <html>
  9. <head>
  10. <base href="<%=basePath%>">
  11. <title>My JSP 'index.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. <!--
  18. <link rel="stylesheet" type="text/css" href="styles.css">
  19. -->
  20. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
  21. <script type="text/javascript" >
  22. function login() {
  23. alert("123123");
  24. alert('<%=loginName%>');
  25. //window.location="/nwyj/page/frameWork.html";
  26. var loginName = ('<%=loginName%>')
  27. var password = '123';
  28. alert(loginName);
  29. //登录处理
  30. $.ajax({
  31. type: "POST",
  32. url:"/nwyj/ws/sys/LoginService/Login",
  33. data: {"username":loginName.value,"password":password},
  34. success: function(data){
  35. window.name = JSON.stringify(data);
  36. window.location="/nwyj/page/frameWork.html";
  37. }
  38. });
  39. alert(loginName);
  40. }
  41. </script>
  42. </head>
  43. <body onload="login()">
  44. </body>
  45. </html>