/**
??* Destruction of the servlet. <br>
??*/
??public void destroy() {
??super.destroy(); // Just puts "destroy" string in log
??// Put your code here
??}

/**
??* The doGet method of the servlet. <br>
??*
??* This method is called when a form has its tag value method equals to get.
??*
??* @param request the request send by the client to the server
??* @param response the response send by the server to the client
??* @throws ServletException if an error oclearcase/" target="_blank" >ccurred
??* @throws IOException if an error occurred
??*/
??public void doGet(HttpServletRequest request?? HttpServletResponse response)
??throws ServletException?? IOException {
??response.setContentType("text/xml");
??response.setHeader("Cache-Control"?? "no-cache");

String targetId = request.getParameter("id");
??System.out.println(targetId.trim());

if ((targetId != null) && users.containsKey(targetId.trim())) {

response.getWriter().write("<info><message>welcome</message><name>sdl</name></info>");
??} else {

response.getWriter().write("<info><message>kill</message><name>bush</name></info>");
??System.out.print("invalid");
??}

}

??/**
??* Initialization of the servlet. <br>
??*
??* @throws ServletException if an error occure
??*/
??public void init(ServletConfig config) throws ServletException {
??this.context = config.getServletContext();
??users.put("greg"??"account data");
??users.put("duke"??"account data");

}

}
??
??[3]дweb.xml???<?xml version="1.0" encoding="UTF-8"?>
??<web-app version="2.4"
??xmlns="http://java.sun.com/xml/ns/j2ee "
??xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
??xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
??http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
??<servlet>
??<description>This is the description of my J2EE component</description>
??<display-name>This is the display name of my J2EE component</display-name>
??<servlet-name>ValidateServlet</servlet-name>
??<servlet-class>com.ValidateServlet</servlet-class>
??</servlet>

<servlet-mapping>
??<servlet-name>ValidateServlet</servlet-name>
??<url-pattern>/servlet/ValidateServlet</url-pattern>
??</servlet-mapping>

</web-app>
??
??[4]?????
?????????IE??FireFox?????????????????????????????????????????”kill you bush”??????index.htm?е?styles.css?????????棬????г?????????????servlet??????????????????????????

??[??????]
??????????tomcat????????xmlHttpRequest??java servlet??html??????