Pure JSP implementation of simple login sample _jsp programming

Source: Internet
Author: User
Tags xmlns

The example in this article describes the simple login method implemented by pure JSP. Share to everyone for your reference, specific as follows:

A total of four web.xml, login.jsp, logout.jsp, welcome.jsp four files

Test environment: Tomcat 6.0.x

Assuming the project name is loginsample, my directory structure is this

... \webapps\loginsample\web-inf\web.xml
... \webapps\loginsample\login.jsp
... \webapps\loginsample\logout.jsp
... \webapps\loginsample\welcome.jsp

Web.xml Source code list:

<web-app xmlns= "HTTP://JAVA.SUN.COM/XML/NS/J2EE"
xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"
xsi:schemalocation= "Http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version= "2.4" >
  <welcome-file-list>
    <welcome-file>welcome.jsp</welcome-file>
  </welcome-file-list>
</web-app>

Login.jsp Source code list:

 <%@ page contenttype= "Text/html;charset=utf-8"%>  
 

Logout.jsp Source code list:

<%@ page contenttype= "Text/html;charset=utf-8"%>
 
 

Welcome.jsp Source code list:

<%@ page contenttype= "text/html" pageencoding= "UTF-8" import= "java.util.*"%>
 
 

I hope this article will help you with JSP program design.

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.