JSP basic syntax & lt; 2 & gt;, JSP + JDBC user login program implementation, jspjdbc

Source: Internet
Author: User

JSP basic syntax <2>: JSP + JDBC user login program implementation, jspjdbc
1.1 create a database table

Table Name: user

Field:

Userid: Save the user's logon id

Name Username

Password

 

1.2 Implementation ideas

A. User Logon requires a table sheet page on which the user's logon id and password can be entered;

B. submit it to a verified jsp page for database operation verification. If user information can be queried, it is a legal user, and the logon success page is displayed;

C. If no query is found, the user is not a legal user, and the error page is displayed;

1.3 Program Implementation

Login. jsp: provides a user login form that allows you to enter the login id and password;

<% @ Page contentType = "text/html" pageEncoding = "GBK" %> 

Login_check.jsp: logon check page. The information submitted in the root form is verified. The logon success page is displayed. Otherwise, the error prompt page is displayed;

<% @ Page contentType = "text/html" pageEncoding = "GBK" %> <% @ page import = "java. SQL. * "%> 

The login_success.jsp logon success page displays the welcome information;

<% @ Page contentType = "text/html" pageEncoding = "GBK" %> 

Login_failure.jsp: logon Failure page, prompting the user to enter an error and providing a hyperlink to log on again;

<% @ Page contentType = "text/html" pageEncoding = "GBK" %> 

   

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.