maven中解决Type javax.servlet.jsp cannot be resolved to a type

解决方案:

在Maven的pom文件中引发如下依赖jar:

<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>

时间: 2024-08-02 19:06:07

maven中解决Type javax.servlet.jsp cannot be resolved to a type的相关文章

javax.servlet.jsp cannot be resolved to a type

把MyEclipse里的项目导入到Eclipse Luna版中后出现了个莫名其妙的错误,注:Eclipse Luna是新装的. 错误描述:jsp页面中引用的js报错,鼠标放上去以后提示:javax.servlet.jsp cannot be resolved to a type.图片为证: 类似以上底下有红色波浪线的错误,好多jsp页面都有,还各不相同. 解决办法: 点击菜单栏:Window→Preferences→Validation,在右侧找"JSP Syntax Validator&quo

javax.servlet.jsp cannot be resolved to a type,javax.servlet

可能是jdk 里不包括servlet-api.jar这个包,到tomcat里找到这个包复制到java项目里. 项目名-->右键 Property-->选择 Java Build Path-->选择 Add External JARs-->选择 把servlet-api.jar的路径输入即可 该包在tomcat里有 搜索即课找到 javaxservletjspJspException cannot be resolved to a type javaxservletjspPageCo

Eclipse------导入项目后出现javax.servlet.jsp cannot be resolved to a type

报错信息:javax.servlet.jsp cannot be resolved to a type 原因1: 这个错误可能是服务器自带的servlet库未导入的原因. 解决方法: 右键项目"Properties",转到Targeted Runtimes,选择一个服务器,例如Tomcat,单击应用,可能就可以解决. 原因2: servlet包只是编译时需要,而发布时不需要,避免与tomcat中的servlet包发生冲突 解决方法: 在pom.xml中添加对servlet-api的依赖

1,eclipse导入项目jdk版本不一样解决方案 2,java报javax.servlet.jsp cannot be resolved to a type

一:eclipse导入项目jdk版本不一样解决方案 参考博文: https://www.cnblogs.com/chenmingjun/p/8472885.html 选中项目右键 --> Properties --> Build Path --> 选中Libraries一栏,移除(Remove)这个库选项, 然后添加新的库选项: Add Library... --> JRE System Library --> next --> Execution environmen

使用EL表达式正确情况下报错:javax.servlet.jsp cannot be resolved to a type

这个错误可能是服务器自带的servlet库未导入的原因.右键项目属性,转到Targeted Runtimes,选择一个服务器,例如Tomcat,单击应用,可能就可以解决.

使用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 错误如下图: 解决方案: 在Maven的pom文件中引发如下依赖即可: <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <versio

javax.servlet.ServletException cannot be resolved to a type错误解决方法

在页面中使用全局路径时${pageContext.request.contextPath}出现javax.servlet.ServletException cannot be resolved to a type错误,解决方法如下: 这个错误主要是因为缺少jsp-api.jar 和  servlet-api.jar这两个Jar包. 第一种解决方法: 直接把 Tomcat7.0 下lib目录中的 jsp-api.jar 添加  Build path 中. 第二种解决方法:使用 Maven 将 js

maven中解决javax.servlet.jsp.PageContext cannot be resolved to a type

在eclipse环境下用maven出现:javax.servlet.jsp.PageContext cannot be resolved to a type. 这是因为没有引入jsp-api引发的问题,在pom.xml引入: <dependency> <span style="white-space:pre"> </span><groupId>javax.servlet</groupId> <artifactId>

Eclipse javax.servlet.jsp.PageContext cannot be resolved to a type 错误解决办法

目前在jsp页面form action中使用${pageContext.request.contextPath }/servlet的写法,但是一直提示有错误,错误如下:javax.servlet.jsp.PageContext cannot be resolved to a type 网上解答过说要缺少jsp-api.jar,导入这个包之后不报错了,但是程序启动访问这个页面的时候出现如下错误: org.apache.jasper.JasperException: Unable to read T