在我的web.xml中
<servlet>
<servlet-name>channelConnected</servlet-name>
<servlet-class>ChannelConnected</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>channelConnected</servlet-name>
<url-pattern>/_ah/channel/connected</url-pattern>
</servlet-mapping>
我的servlet
public class ChannelConnected extends HttpServlet{
private static final long serialVersionUID = 1L;
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException{
System.out.println("hello world");
}
}
我总是收到这个错误:
WARNING: No file found for: /_ah/channel/connected/
我的请求处理程序出了什么问题?
答案 0 :(得分:1)
在网址模式中添加反斜杠可以使其正常工作。
<url-pattern>/_ah/channel/connected/</url-pattern>