私は登録サーブレットを持っています。doGetはサーブレットでは機能しません
@WebServlet("/register")
public class RegisterServlet extends HttpServlet {
...
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("in servlet");
}
}
私はそのページに行けば、私は
HTTP Status 404 -
type Status report
message
description The requested resource is not available.
Apache Tomcat/8.0.36
私は@WebServletで@WebServlet( "/登録")( "/レジスタ1")を変更すると、すべてが正常に動作を取得します。 この状況を修正するにはどうすればよいですか?
web.xmlの
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<display-name>booker</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>pages/index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>controllers</param-name>
<param-value>com.epam.task.controller</param-value>
</context-param>
<session-config>
<session-timeout>-1</session-timeout>
</session-config>
</web-app>
web.xmlを追加できますか? –