Jsp + servlet + JavaBean implementation login web page example details

This paper describes the method of login web page with JSP + servlet + JavaBean. Share with you for your reference. The details are as follows:

Four documents are involved:

1. Login page: login html 2. Login success welcome page: Login_ success. jsp 3. Login failure page: Login_ failure. jsp 4. Servlet processing file: loginservlet java

In fact, it also involves a file: Web XML, which will be explained later:

The following documents are introduced respectively:

1. Login page: login html

2. Login success welcome page: Login_ success. jsp

3. Login failure page: Login_ failure. jsp

4. Servlet processing file: loginservlet java

In order to make this website work properly, we have to go to the web XML. Now the contents of the file are modified as follows:

Well, these files can form our login interface

matters needing attention:

1. File directory form

login. html,login_ success. html,login_ failure. HTML these three files are placed in the same directory, loginservlet The bytecode file loginservlet. Java of this file Class is placed in the WEB-INF / classes directory (note the order of jar packages). Now the directory form of the whole project is: M: / tomcat5 5/webapps/JSP_ Servlet_ JavaBean_ Login directory 007-01-18 15:16 < dir > meta-inf 007-01-18 15:16 < dir > WEB-INF 007-01-18 16:17 1801 login html 007-01-18 15:48 858 login_ failure. jsp 007-01-18 15:40 234 login_ success. html 007-01-18 15:46 781 MyJsp. jsp 007-01-18 16:12 859 login_ success. jsp M:/Tomcat5. 5/webapps/JSP_ Servlet_ JavaBean_ Login / WEB-INF directory 007-01-18 15:16 < dir > classes 007-01-18 15:16 < dir > lib 007-01-18 16:21 606 web xml M:/Tomcat5. 5/webapps/JSP_ Servlet_ JavaBean_ Directory of login / WEB-INF / classes / zieckey / login / servlet 2007-01-18 16:18 3900 loginservlet class

2. Other precautions

The database MySQL server program should be started first

I hope this article will be helpful to your JSP programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>