Servlet中web.xml映射问题之访问路径报错-404

xiaoxiao2021-02-28  35

1.web.xml中  <servlet-mapping>     <servlet-name> AdminServlet</servlet-name>     <url-pattern> /AdminServlet</url-pattern>   </servlet-mapping> 2.jsp 中 <form name="form" action = "${pageContext.request.contextPath }/AdminServlet" method="post"> ................ </form> 问题:<url-pattern>/AdminServlet</url-pattern>中/AdminServlet一定要和${pageContext.request.contextPath}/AdminServlet中的/AdminServlet 一一对应,否则报404错误!
转载请注明原文地址: https://www.6miu.com/read-1450175.html

最新回复(0)