Now there is a need to asynchronously verify whether the username exists. The technology used is jQuery asynchronous verification and struts2 (in fact, springMVC is the same, it is just a controller).
/** * Query whether this department exists based on the department name * * @return * @throws Exception */ public String checkdeptname() throws Exception { if (UtilAPI.isNull(dept)) { dept = new Dept(); } int count = this.deptService.checkdeptname(dept.getId(), dept.getDept_name()); / /Returns 1 if it exists, returns 0 if it does not exist try { response.getOutputStream().print(count); } catch (IOException e) { e.printStackTrace() ; } return Action.NONE; }
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