The actual project compares commonly used (JQUERY+AJAX+MD5), belongs to the instant verification, the bright spot is verifies the user to exist that item, the concrete content is as follows
Specific examples
registe.jsp
<span style= "Font-size:large;" ><%@ page pageencoding= "UTF-8"%> <%@ taglib uri= "Http://java.sun.com/jsp/jstl/core" prefix= "C"%> <% @ taglib uri= "http://java.sun.com/jsp/jstl/fmt" prefix= "FMT"%> <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
Accountservlet.java
<span style= "Font-size:large;" >package com.validator.test;
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 Accountservlet extends HttpServlet {public
void doget (HttpServletRequest request, HttpServletResponse Response)
throws Servletexception, IOException {
this.dopost (request, response);
public void DoPost (HttpServletRequest request, httpservletresponse response)
throws Servletexception, IOException {
String loginname=request.getparameter ("LoginName");
PrintWriter out = Response.getwriter ();
if (Loginname.equals ("abc123")) {
out.println ("1");
} else{
out.println ("0");
}
Out.flush ();
}
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.