package tt;

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 TestA extends HttpServlet {

	 
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		 
		//设置接收的信息的字符集
		request.setCharacterEncoding("UTF-8");
		
		String name=request.getParameter("name");
		
		//设置输出的信息的格式及字符集
		response.setContentType("text/xml; charset=UTF-8");
		response.setHeader("Cache-Control","no-cache");
		
		//创建输出流
		PrintWriter out=response.getWriter();
			
		out.println("<pront>");
		if(name.equals("jack_booth")){
			out.println("<content>"+"对不起，此网名已注册!"+"</content>");
		
		}else{
			out.println("<content>"+"此网名可以注册!"+"</content>");
		}
		out.println("</pront>");
		out.close();
		
	}
	
}
