看了两天的百度,各种配置各种改
404请求地址不对
默认页面是哪个?
看一下你的web.xml
web.xml文件
这个是默认的访问页,只用一个就可以
index.jsp
但是后面的配置还是少了
tomcat servr配置
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<servlet>
<servlet-name>loginServlet</servlet-name>
<servlet-class>Servlet.loginServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>loginServlet</servlet-name>
<url-pattern>/loginServlet</url-pattern>
</servlet-mapping>
</web-app>
大兄弟,你使用的IDE配置的Tomcat,请找到真正的项目部署位置。
比如:我的项目是放在:D:\servlet\JspWeb
对应的项目部署目录在:D:\servlet.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps中
请把Tomcat目录中的ROOT项目覆盖此目录下的项目