IDEA+SpringMVC+Gradle 配置Servlet报错

我是李小米 2017-12-25 05:18:05
在使用Idea配置SpringMVC+gradle环境时,在web.xml文件下的<Servlet-mapping>标签中servlet-name报错。查找未果,特来求助,求各位大神指导。


第一个异常:

Servlet should have a mapping less... (Ctrl+F1)

Checks if all servlets have mappings

第二个异常:Cannot resolve Servlet 'ListServlet' less... (Ctrl+F1)

This inspection lets you spot the following problems that might occur in descriptors that are used to deploy your Web Module to a server:

References to the non-instantiable classes

References to the classes that do not extend required class

References to classes with inappropriate scope

Empty tag and attribute values

Tag and attribute values that do not match required pattern (e.g. Java Identifiers)

Tags that do not include required children tags or attributes

Tags that define objects with duplicate names
...全文
617 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
三层饼干儿 2019-07-29
  • 打赏
  • 举报
回复
引用 5 楼 我是李小米 的回复:
引用 4 楼 三层饼干儿 的回复:
别给我啊,老哥,我啥也没干啊。。。这不是浪费了。。。
尴尬了,以为是一个人呢。
长这么大,第一次有分,有一丝小激动。哈哈哈哈哈哈
我是李小米 2019-07-29
  • 打赏
  • 举报
回复
引用 4 楼 三层饼干儿 的回复:
别给我啊,老哥,我啥也没干啊。。。这不是浪费了。。。
尴尬了,以为是一个人呢。
三层饼干儿 2019-07-29
  • 打赏
  • 举报
回复
别给我啊,老哥,我啥也没干啊。。。这不是浪费了。。。
三层饼干儿 2019-07-29
  • 打赏
  • 举报
回复
引用 1 楼 yumengzth 的回复:
idea点击project structure 在Deployment Descriptors视窗下点击右边的加号选择web.xml,找到web.xml的位置即可,我的问题是这样解决的
不给分有点过分了。。。。
韩梦寒梦! 2019-04-16
  • 打赏
  • 举报
回复
我也是这个错误
yumengzth 2019-03-20
  • 打赏
  • 举报
回复
idea点击project structure



在Deployment Descriptors视窗下点击右边的加号选择web.xml,找到web.xml的位置即可,我的问题是这样解决的






81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧