Servlet Writing Login Interface

Source: Internet
Author: User

Package COM.MHB;

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;

public class Loginservlet extends HttpServlet {

public void Init () throws Servletexception {
}

public void doget (HttpServletRequest request, httpservletresponse response)
Throws Servletexception, IOException {
Response.setcontenttype ("text/html;charset=gb2312");
Response.setheader ("Content-type", "text/html;charset=utf-8");
PrintWriter out = Response.getwriter ();
Out.print ("Out.print ("<body><br/>");
Out.print ("<b> enter username and password </b><br/>");

Out.print ("<form action=" method= ' Get ' ><br/> ");
Out.print ("<table><tr><td align= ' right ' > Username:</td>");
Out.print ("<td><input type= ' text ' name= ' username ' ></td>");
Out.print ("<tr><td align= ' right ' > Password:</td>");
Out.print ("<td><input type= ' password ' name= ' password ' ></td>");
Out.print ("<tr><td conspan= ' 2 ' ><input type= ' submit ' value= ' submission ' >" +
"<input type= ' reset ' value= ' resets ' ></td></tr></table>");
Out.print ("</form><br/>");
Out.print ("</body><br/>");
Out.print ("}

public void DoPost (HttpServletRequest request, httpservletresponse response)
Throws Servletexception, IOException {
}
public void Destroy () {
Super.destroy ();
}
}

Browser display

Servlet Writing Login Interface

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.