<% @ Page Language = "Java" contenttype = "text/html; charset = UTF-8" pageencoding = "UTF-8" %> <! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en" "http://www.w3.org/TR/html4/loose.dtd"> <HTML>
Servlet
Protected void dopost (httpservletrequest request, httpservletresponse response) throws servletexception, ioexception {// todo auto-generated method stublist <string> usernames = arrays. aslist ("AAA", "BBB", "CCC"); string username = request. getparameter ("username"); string result = NULL; If (usernames. contains (username) {result = "<font color = 'red'> this user name has been used </font> ";} else {result = "<font color = 'red'> this user name can be used </font>";} response. setcontenttype ("text/html; charset = UTF-8"); response. setcharacterencoding ("UTF-8"); response. getwriter (). print (result );}
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/4B/F6/wKiom1Q2N6DAbcXoAAA3LBrlRkM507.jpg "Title =" qq20141009152149.png "alt =" wkiom1q2n6dabcxoaaa3lbrlrkm507.jpg "/>
This article is from the "Avatar" blog, please be sure to keep this source http://shamrock.blog.51cto.com/2079212/1561787
Ajax learning notes-Verify that the user name is available