Eclipse无法配置web.xml解决方案

/**
*

  • @author E0A9850
  • 不用配置web.xml,引入WebServlet(name="",value="")
    */
    @WebServlet(name=“PrintServlet”,value="/PrintServlet")//name=,value=

public class PrintServlet extends HttpServlet {

/**
 * 
 */
private static final long serialVersionUID = 1L;

public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException {
	String data="itcast-OutputStream";
	OutputStream out=response.getOutputStream();
	out.write(data.getBytes());	
	//PrintWriter print=response.getWriter();
	//print.write(data);
}

public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException {
	doGet(request,response);
}

}

你可能感兴趣的:(Eclipse无法配置web.xml解决方案)