⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login_jsp.java

📁 基于MVC体系架构编写的login功能模块
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class login_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.Vector _jspx_dependants;

  private org.apache.jasper.runtime.ResourceInjector _jspx_resourceInjector;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html;charset=UTF-8");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;
      _jspx_resourceInjector = (org.apache.jasper.runtime.ResourceInjector) application.getAttribute("com.sun.appserv.jsp.resource.injector");

      out.write("\n");
      out.write("\n");
      out.write("\n");
      out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n");
      out.write("   \"http://www.w3.org/TR/html4/loose.dtd\">\n");
      out.write("\n");
      out.write("<html>\n");
      out.write("    <head>\n");
      out.write("        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n");
      out.write("        <title>Login</title>\n");
      out.write("    </head>\n");
      out.write("\n");
      out.write("<script language=\"javascript\"> \n");
      out.write("    if(form1.username.value == \"\") \n");
      out.write("        {alert(\"用户名不能为空,请输入用户名!\"); \n");
      out.write("            form1.username.focus(); \n");
      out.write("            return false;} \n");
      out.write("    if(form1.password.value==\"\") \n");
      out.write("        {alert(\"用户密码不能为空,请输入密码!\"); \n");
      out.write("             form1.password.focus(); \n");
      out.write("             return false;}                       \n");
      out.write("</script>\n");
      out.write("    <body>\n");
      out.write("        <h1>Welcome To Login!</h1>\n");
      out.write("        <br>\n");
      out.write("        <h4>注册中心的注册用户,输入个人用户名,密码向服务器提取用户的信息。<br>\n");
      out.write("        未注册用户,可以以访客形式匿名浏览网站。</h4>\n");
      out.write("        <form action=\"LoginServlet?action=login\" method=\"post\">\n");
      out.write("            个人用户:<input type=\"text\" name=\"username\" onkeyup=\"value=value.replace(/[\\W]/g,'')\" onbeforepaste=\"clipboardData.setData('text',clipboardData.getData('text').replace(/[^\\d]/g,''))\"  /> \n");
      out.write("(只能输入字母和数字)<br>\n");
      out.write("            用户密码:<input type=\"password\" name=\"password\">\n");
      out.write("                <br>\n");
      out.write("            用户权限:<select name=\"authority\">\n");
      out.write("                <option value=\"registeruser\">注册用户</option>\n");
      out.write("                <option value=\"anonymous\">匿名用户</option>\n");
      out.write("                <option value=\"management\">系统管理员</option>\n");
      out.write("                    </select>\n");
      out.write("                <br><br>\n");
      out.write("            <input type=\"submit\" name = \"submit\" value=\"提交\">\n");
      out.write("            <input type=\"reset\" name = \"reset\" value=\"重填\">\n");
      out.write("        </form>\n");
      out.write("            \n");
      out.write("        <form action=\"LoginServlet?action=register\" method=\"post\">\n");
      out.write("         <input type=\"submit\" name=\"submit\" value=\"注册\">\n");
      out.write("        </form>\n");
      out.write("        <form name=\"form\" action=\"anonymous.jsp\" method=\"post\">\n");
      out.write("            <input type=\"submit\" name=\"submit\" value=\"匿名登录\">\n");
      out.write("        </form>\n");
      out.write("    </body>\n");
      out.write("</html>\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -