资源简介

概述:实现登录功能,用户输入帐号和密码,通过form表单提交至后台处理,查询数据库,如果用户名和密码均正确,则弹框提示用户登录成功,否则提示登录失败。

开发工具:eclipse Mars.2 Release (4.5.2)
服务器 :apache-tomcat-7.0.68
数据库:MySql


前台源码:用到了简单的 bootstrap 和 jquery
后台代码:使用了servlet

资源截图

代码片段和文件信息

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License Version 2.0
 * (the “License“); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing software
 * distributed under the License is distributed on an “AS IS“ BASIS
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package mypackage;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * Simple servlet to validate that the Hello World example can
 * execute servlets.  In the web application deployment descriptor
 * this servlet must be mapped to correspond to the link in the
 * “index.html“ file.
 *
 * @author Craig R. McClanahan 
 */

public final class Hello extends HttpServlet {

    private static final long serialVersionUID = 1L;

    /**
     * Respond to a GET request for the content produced by
     * this servlet.
     *
     * @param request The servlet request we are processing
     * @param response The servlet response we are producing
     *
     * @exception IOException if an input/output error occurs
     * @exception ServletException if a servlet error occurs
     */
    @Override
    public void doGet(HttpServletRequest request
                      HttpServletResponse response)
      throws IOException ServletException {

        response.setContentType(“text/html“);
        PrintWriter writer = response.getWriter();

        writer.println(““);
        writer.println(““);
        writer.println(“tle>Sample Application Servlet Pagetle>“);
        writer.println(““);
        writer.println(““);

        writer.println(““);
        writer.println(““);
        writer.println(““);
        writer.println(““);
        writer.println(““);
        writer.println(““);
        writer.println(“

Sample Application Servlet

“);
        writer.println(“This is the output of a servlet that is part of“);
        writer.println(“the Hello World application.“);
        writer.println(““);
        writer.println(““);
        writer.println(““);

        writer.println(““);
        writer.println(““);

    }


}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        838  2017-06-25 11:45  javaweb\mysql数据库\test.sql

     文件        305  2020-09-11 11:39  javaweb\readme.txt

     文件        955  2019-05-22 12:36  javaweb\sourcecode\mysqlTest\.classpath

     文件       1042  2017-06-25 10:12  javaweb\sourcecode\mysqlTest\.project

     文件        567  2017-06-25 10:12  javaweb\sourcecode\mysqlTest\.settings\.jsdtscope

     文件        364  2017-06-25 10:12  javaweb\sourcecode\mysqlTest\.settings\org.eclipse.jdt.core.prefs

     文件        479  2017-06-25 10:12  javaweb\sourcecode\mysqlTest\.settings\org.eclipse.wst.common.component

     文件        345  2019-05-22 12:36  javaweb\sourcecode\mysqlTest\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2017-06-25 10:12  javaweb\sourcecode\mysqlTest\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2017-06-25 10:12  javaweb\sourcecode\mysqlTest\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       3860  2019-06-02 10:46  javaweb\sourcecode\mysqlTest\build\classes\com\test\LoginServlet.class

     文件       3640  2019-05-30 14:45  javaweb\sourcecode\mysqlTest\src\com\test\LoginServlet.java

     文件     141182  2017-06-25 10:19  javaweb\sourcecode\mysqlTest\WebContent\css\bootstrap.css

     文件       1676  2017-06-25 11:26  javaweb\sourcecode\mysqlTest\WebContent\index.jsp

     文件      70843  2017-06-25 10:19  javaweb\sourcecode\mysqlTest\WebContent\js\jquery.js

     文件         39  2017-06-25 10:12  javaweb\sourcecode\mysqlTest\WebContent\meta-INF\MANIFEST.MF

     文件     536609  2017-06-02 09:08  javaweb\sourcecode\mysqlTest\WebContent\WEB-INF\lib\mysql-connector-java-5.0.7-bin.jar

     文件       1012  2017-06-25 10:47  javaweb\sourcecode\mysqlTest\WebContent\WEB-INF\web.xml

     目录          0  2019-06-02 10:46  javaweb\sourcecode\mysqlTest\build\classes\com\test

     目录          0  2019-06-02 10:46  javaweb\sourcecode\mysqlTest\build\classes\com

     目录          0  2017-06-25 11:44  javaweb\sourcecode\mysqlTest\src\com\test

     目录          0  2017-06-25 11:44  javaweb\sourcecode\mysqlTest\WebContent\WEB-INF\lib

     目录          0  2019-06-02 10:46  javaweb\sourcecode\mysqlTest\build\classes

     目录          0  2017-06-25 11:44  javaweb\sourcecode\mysqlTest\src\com

     目录          0  2017-06-25 11:44  javaweb\sourcecode\mysqlTest\WebContent\css

     目录          0  2017-06-25 10:19  javaweb\sourcecode\mysqlTest\WebContent\img

     目录          0  2017-06-25 11:44  javaweb\sourcecode\mysqlTest\WebContent\js

     目录          0  2017-06-25 11:44  javaweb\sourcecode\mysqlTest\WebContent\meta-INF

     目录          0  2017-06-25 11:44  javaweb\sourcecode\mysqlTest\WebContent\WEB-INF

     目录          0  2019-05-22 12:36  javaweb\sourcecode\mysqlTest\.settings

............此处省略888个文件信息

评论

共有 条评论