能贴一下你的web.xml代码吗?<?xml version="1.0" encoding="UTF-8"?>
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
This is the description of my J2EE component
This is the display name of my J2EE component
LoginServlet
servlet.LoginServlet
LoginServlet
/servlet/LoginServlet
login.jsp
这是我的web.xml里面的内容,你试试复制过去看看,行不?
你所说的xml文件里面的内容没有写,是不是你新建工程的时候就没有xml,要你自己建的?在新建web工程时,不要立刻按finish,按next,把生成web.xml文件勾选上。