idea中web.xml报错 Servlet should have a mapping

配置springmvc时,报错,实际mapping已经写了,错误截图如下:

搜索无果,后来发现是工程的web.xml位置配置错误,因为我之前换过根目录位置。 
修改方法: 
打开Project Structure界面,Modules>Web>Deployment descriptor,修改正确的位置即可,如下图:

ps:打开Project Structure的方法: 
1、在单机工程名,按F4 
2、Ctrl+Shift+a,输入Project Structure进行搜索

转载:http://www.itdadao.com/articles/c15a1162290p0.html

时间: 2024-12-18 13:44:32

idea中web.xml报错 Servlet should have a mapping的相关文章

web.xml报错Cannot resolve class 'StrutsPrepareAndExecuteFilter' (idea创建SSH项目)

原因: xwork-core.jar包已经合并到struts2-core.jar下,并且点开jar包,发现没有 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter查阅相关资料后得知:struts2 2.5之后,这个filter移动到了org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter 这就是典型的过度依赖工具!写下此文告诫自己,

maven web项目的web.xml报错The markup in the document following the root element must be well-formed.

maven项目里面的web.xml开头约束是这样的 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java

Ecliplse 重命名后web.xml 报错Attribute &quot;xmlns&quot; was already specified for element &quot;web-app&quot;.

报错信息:Attribute "xmlns" was already specified for element "web-app" 由于项目的重命名,出现了xmlns的重复赋值,这可能是eclipse自己设定的一种方式,重新为项目匹配合适的配置. <web-app xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns=”http://java.sun.com/xml/ns/javaee” xm

Springboot项目中Pom.xml报错

摘要:使用idea,两次在maven上浪费时间,第一次不知道怎么就解决了,第二次记录一下解决办法 情况说明:界面如下图,pom.xml中存在多个jar,报错,依赖没有找到,检查maven模型以解决问题 参考博客地址: https://blog.csdn.net/u013129944/article/details/53870373 https://blog.csdn.net/lishaoran369/article/details/53994601 即报错:dependencies not fi

关于SpringMvc中web.xml配置的Servlet

<servlet>   <!-- 配置DispatcherServlet -->   <servlet-name>springMvc</servlet-name>   <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>     <!-- 指定spring mvc配置文件位置 不指定使用默认情况 -->     &l

web.xml报错

在写web.xml的时候又一次总是报cvc-complex-type.2.4.a: Invalid content was found starting with element 错误,还出现小红叉,在网上找了很多,有说是把报红叉的代码写在<jsp-config></jsp-config>之间,试了之后发现完全没用. 后来在外文网站上找到了一个方法就把问题解决了解决方法二: <async-supported>true</async-supported>是we

利用Eclipse中的Maven构建Web项目报错

利用Eclipse中的Maven构建Web项目 1.在进行上述操作时,pom.xml一直报错 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.o

Servlet中Web.xml文件的配置

1 定义头和根元素 部署描述符文件就像所有XML文件一样,必须以一个XML头开始.这个头声明可以使用的XML版本并给出文件的字符编码.DOCYTPE声明必须立即出现在此头之后.这个声明告诉服务器适用的servlet规范的版本(如2.2或2.3)并指定管理此文件其余部分内容的语法的DTD(Document Type Definition,文档类型定义).所有部署描述符文件的顶层(根)元素为web-app.请注意,XML元素不像HTML,他们是大小写敏感的.因此,web-App和WEB-APP都是不

servlet 中 web.xml 备忘 总结

<?xml version="1.0" encoding="UTF-8"?><web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.