Tomcat 7 和 JSTL [英] Tomcat 7 and JSTL

查看:24
本文介绍了Tomcat 7 和 JSTL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Eclipse Tomcat 编写了一个 Web 应用程序,它可以在我本地的 Tomcat 7 上运行,当我尝试在 Tomcat 7 上在线发布它时,出现以下错误:

I wrote a web application with Eclipse Tomcat and it works on my local Tomcat 7, when I tried to publish it online on a Tomcat 7, I had the following error:

严重:servlet [obliquid.servlet.Index] 在上下文中与路径 [/cp] 的 Servlet.service() 抛出异常 [绝对 uri:http://java.sun.com/jsp/jstl/core 无法在 web.xml 或使用此应用程序部署的 jar 文件中解析]

SEVERE: Servlet.service() for servlet [obliquid.servlet.Index] in context with path [/cp] threw exception [The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application]

Tomcat 7 有Spec versions: Servlet 3.0, JSP 2.2, EL 2.2",所以不包括 JSTL?

Tomcat 7 has "Spec versions: Servlet 3.0, JSP 2.2, EL 2.2", so JSTL is not included?

当我尝试上传standard.jar和jstl.jar时出现以下错误:

When I tried to upload standard.jar and jstl.jar I had the following error:

org.apache.jasper.JasperException:/jsp/index.jsp(第 3 行,第 62 列)无法从 JAR 文件jndi:/localhost/cp/"中读取 TLDMETA-INF/c.tld"WEB-INF/lib/standard.jar":org.apache.jasper.JasperException:无法加载或实例化 TagLibraryValidator 类:org.apache.taglibs.standard.tlv.JstlCoreTLV

org.apache.jasper.JasperException: /jsp/index.jsp (line: 3, column: 62) Unable to read TLD "META-INF/c.tld" from JAR file "jndi:/localhost/cp/WEB-INF/lib/standard.jar": org.apache.jasper.JasperException: Failed to load or instantiate TagLibraryValidator class: org.apache.taglibs.standard.tlv.JstlCoreTLV

我做了一些谷歌搜索,但我无法解决,有人说这可能是由 jars 的版本冲突引起的.也许我不应该包含这些 jars 并使用不同的 JSTL url?我的适用于 JSTL 1.1,我想,JSTL 1.2 有新的 URL 吗?

I did some googling, but I couldn't sort it out, some said it could be caused by conflicting versions of the jars. Maybe I should not include those jars and use a different JSTL url? Mine is for JSTL 1.1 I think, is there a new URL for JSTL 1.2?

我应该怎么做才能解决问题并使这个应用程序运行?

What should I do to solve the problem and make this application run?

推荐答案

Tomcat 从未包含 JSTL.

Tomcat has never included JSTL.

您应该将 jstl 和标准 jars 放在 WEB-INF/lib 中(您已经完成了),并确保您具有读取它们的权限(chmod)

You should put the jstl and standard jars in WEB-INF/lib (you've done that), and make sure you have the permissions to read them (chmod)

你的 URI 是正确的,它应该可以工作(在这里工作)

Your URI is correct and it should work (works here)

这篇关于Tomcat 7 和 JSTL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆