Home > Web Front-end > JS Tutorial > struts2 jquery combination to verify whether registered users exist_jquery

struts2 jquery combination to verify whether registered users exist_jquery

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 16:50:44
Original
1137 people have browsed it

Registration interface register.jsp

Copy code The code is as follows:

<%@ page language= "java" contentType="text/html; charset=UTF-8"%>


Registration interface






















< h3>
User registration


Username:






Password :


Repeat password:







< ;/html>

action method
Copy code The code is as follows:

/**
* Find if the user exists
*
* @return
* @throws IOException
*/
public String findByName() throws IOException {
List listPerson = ms.findByName(name);
String findByNameTip;
if (listPerson .size() > 0) {
findByNameTip = "exist"; // User exists
} else {
findByNameTip = "noexist"; // User does not exist
}
ServletActionContext .getResponse().getWriter().print(findByNameTip);
return null;
}
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template