- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 jsp 页面中看到以下错误 -
javax.servlet.jsp.PageContext cannot be resolved to a type
javax.servlet.jsp.JspException cannot be resolved to a type
我看过一篇关于此的帖子,并尝试了一些建议的事情。 BalusC 提供了很好的输入 - JSTL1.2 和 Standard.jar 不得一起使用。我这样做了,它解决了这个问题一段时间 - 但它又重新出现了。我不确定是否还有其他 jar 碰撞。我已将所有 jar 定义为 Maven 中的依赖项。以下是我指定的 pom.xml 的依赖项 -
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.38</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.6</version>
</dependency>
</dependencies>
最佳答案
您需要在项目中导入 JSP API,这些 API 未包含在 servlet-api 中
在我的项目中,解决方案是:
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
关于jsp - javax.servlet.jsp.PageContext 无法解析为类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8669387/
我一直热衷于重置我的一个 jsp 页面上的一些验证错误。这是一个我无法再联系到的人(死亡或无法联系)继承的项目。我有一个 jsp 页面,其中包含许多自定义标记库,其中更多页面被添加为选项卡,父页面具有
我正在尝试为我的 JSP TagLib 类构建一个公共(public)类我有 class MyTag extends CustomTag { public int doEndTag() {
jsp PageContext 对象是作为 http 请求-响应周期的一部分创建和销毁的,还是在请求之间缓存和重用。 PageContext 具有建议在请求之间重用的生命周期方法。即初始化(),释放(
通常,要在 JSP 中获取请求 URL,我会使用 ${pageContext.request.requestURL} 但是在我正在处理的项目中(因为我猜我们使用了瓷砖)如果我运行上面的我得到类似的东西
据我了解,pageContext 可以访问许多方法,例如getPage、getRequest 等。那么简单地访问不是更好吗与使用页面上下文相反,您直接需要什么?问题我不知道你会怎么做。所以说我有这个:
有人知道如何模拟以下内容吗? pageContext.getRequest().getParameter("par");// here I get a null pointer exception o
我正在使用 Tomcat 6.0.32,我正试图将一个 JSP 文件包含到另一个文件中,但不知何故无法找到该文件(是的,该文件存在)。这是文件结构和代码: WebContent - folder/
${pageContext.request.contextPath} 如何在本地和远程工作?这是a link !以及指向 a panda 的引用样式链接。引用文献不必是 numbers . 最佳答案
我的一个jsp在声明中有一个函数 这个performLogic函数需要通过pagecontext作为参数调用GetRequestViaXML函数,所以这个pagecontext将被用来获取之前在js
当我们可以访问 JSP 中的所有隐式变量时,为什么我们有 pageContext ? 我的假设如下:如果我们使用 EL 表达式或 JSTL,来访问或设置我们需要的属性 pageContext。让我知道
这是对 accessing resources in jsp page of spring mvc app 上的问题的跟进。感谢@kmb385,我能够解决该问题,但现在我的 JSP 文件中出现以下 E
我的 JSP 页面包含: var bt_wd40_appurl = "${pageContext.request.contextPath}"; View /源显示“”作为值。到目前为止我没
这个问题已经有答案了: How do I import the javax.servlet / jakarta.servlet API in my Eclipse project? (16 个回答)
这个问题已经有答案了: EL expressions not evaluated in JSP (5 个回答) 已关闭 3 年前。 当我使用我的 Hello 我的网址变成了 http://localh
我在 servlet 中设置了这个 context.setAttribute("isGood", isGood) 以便能够使用 pageContext.findAttribute("isGood")
目前我有一个 .jsp 项目,我的欢迎页面是一个 servlet frontpage servlet 集有两个资源,一个包含 的头文件和一个包含 的页脚 request.setAttribute("
我正在使用 tomcat 7.0。现在我面临无法加载 css 和 js 文件的问题。尝试添加 ${pageContext.request.contextPath} 但不起作用,还尝试了 c:url 标
我处于一种奇怪的情况,我发现我目前必须使用两种不同的路径命名约定,具体取决于我是在本地主机上测试还是我的应用程序部署到我的域。 当我在本地运行我的应用程序时,我在这里访问它:localhost:808
我有一个下一个问题。在 jsp 页面中,我根据角色使用 2 个用户(导师和学生)的菜单,我从菜单文件中选择应包含的内容。像这样 我
这个问题在这里已经有了答案: What does this expression language ${pageContext.request.contextPath} exactly do in
我是一名优秀的程序员,十分优秀!