使用Maven创建Web项目后,jsp引入静态文件提示报错。JSP 报错:javax.servlet.ServletException cannot be resolved to a type
来源:互联网 发布:耐思尼克域名如何解析 编辑:程序博客网 时间:2024/04/30 03:33
版权声明:本文为博主原创文章,未经博主允许不得转载。
使用Maven创建Web项目后,jsp引入静态文件提示报错。
错误提示:javax.servlet.ServletException cannot be resolved to a type
错误如下图:
解决方案:
1. 在Maven的pom文件中引发如下依赖即可:
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2.1-b03</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>3.0-alpha-1</version>
</dependency>
2. 构建路径下引入web容器
选中项目 --> 右键 --> Build Path --> Configure Build Path.. --> Add Library (Libraries 选项卡) --> Server Runtime . 如下图:
本人推荐使用第二种方式
友情链接:Maven 中央仓库地址:http://mvnrepository.com/
0 0
- 使用Maven创建Web项目后,jsp引入静态文件提示报错。JSP 报错:javax.servlet.ServletException cannot be resolved to a type
- 使用Maven创建Web项目后,jsp引入静态文件提示报错。JSP 报错:javax.servlet.ServletException cannot be resolved to a type
- Maven创建Web项目,jsp引入静态文件提示报错(javax.servlet.ServletException cannot be resolved to a type ) 解决办法
- jsp页面引入css文件报错 javax.servlet cannot be resolved to a type
- jsp页面引入css文件报错 javax.servlet cannot be resolved to a type
- jsp页面文件报错 javax.servlet cannot be resolved to a type
- JSP页面无故报错 javax.servlet.jsp.PageContext cannot be resolved to a type
- JSP页面无故报错 javax.servlet.jsp.PageContext cannot be resolved to a type
- JSP页面无故报错 javax.servlet.jsp.PageContext cannot be resolved to a type
- jsp页面报错: javax.servlet.jsp.PageContext cannot be resolved to a type
- jsp页面报错javax.servlet.jsp.JspException cannot be resolved to a type
- 解决JSP文件头文件报错javax.servlet.jsp.JspException cannot be resolved to a type
- 报错:javax.servlet.jsp.PageContext cannot be resolved to a type
- 报错:javax.servlet.jsp.PageContext cannot be resolved to a type
- Maven项目中提示javax.servlet.jsp cannot be resolved to a type
- jsp页面报javax.servlet.jsp.PageContext cannot be resolved to a type:
- JSP页面报javax.servlet.jsp.PageContext cannot be resolved to a type 错误
- eclipse中javax.servlet.jsp.JspException cannot be resolved to a type和HttpServlet报错问题
- 马士兵老师经典J2SE中的经典语录
- Android在一个APP中通过包名或类名启动另一个APP
- 我的Android之旅(二十二)---使用Gosn解析JSON数据
- MVC架构模式与xib
- linux驱动之:模块基本知识
- 使用Maven创建Web项目后,jsp引入静态文件提示报错。JSP 报错:javax.servlet.ServletException cannot be resolved to a type
- win7+ubuntu 双系统安装方法
- VPS+SS搭建自己的VPN
- Surfaceview
- java多线程之线程状态
- 第三节 css常用属性&&盒模型
- post和get请求具体代码封装
- Merit价值与成果管理系统——2、首页以及按时段统计
- python Fabric库学习