正常情况下我们提交表单到下页一般都这么写:<form name = "login" action = "<%= request.getContextPath() %>/login.jsp" method = "post">
或者<form name = "login" action = "<%= request.getContextPath() %>/Login" method = "post">
并在web.xml配置 <servlet>
<servlet-name>Login</servlet-name>
<display-name>Login</display-name>
<servlet-class>Servlets.Login</servlet-class>
</servlet> <servlet-mapping>
<servlet-name>Login</servlet-name>
<url-pattern>/Login</url-pattern>
</servlet-mapping>
但我最近接触到的一个项目它是按照下列方式写的,并且在web.xml中没有配置任何信息,请问这是什么原因呢,按理说是不能运行的吧,但
<form name = "login" action = "<%= request.getContextPath() %>/handler/Login" method = "post">