在JSP 2.0中使用JSF 2.1时出错:无法从JAR文件读取TLD [英] Error using JSF 2.1 with JSP 2.0: Unable to read TLD from JAR file

查看:200
本文介绍了在JSP 2.0中使用JSF 2.1时出错:无法从JAR文件读取TLD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在JSP 2.0中使用JSF 2.1.

I try to use JSF 2.1 within JSP 2.0.

当我添加此<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

我收到以下错误:

Unable to read TLD "META-INF/html_basic.tld" from JAR file
    "file:/home/fadhel/.m2/repository/javax/javaee-web-api/6.0/javaee-web-api-6.0.jar":
org.apache.jasper.JasperException: PWC6169:
    Failed to load or instantiate TagLibraryValidator class: com.sun.faces.taglib.html_basic.HtmlBasicValidator.

有人可以告诉我如何在Java 6中使用JSF 2.1和JSP 2.0吗?

Can someone tell what I can do to use JSF 2.1 and JSP 2.0 with Java 6?

推荐答案

我相信特定的Maven库仅用于Java编译.您不能在运行时使用它(即使用于单元测试).如果要在服务器上运行它,请确保将依赖项标记为provided.

I believe that particular Maven library is provided only for Java compilation. You can't use it at runtime (even for unit tests.) If you are getting this running against a server, make sure the dependency is marked as provided.

如果要加载库,则必须依赖真实的API.由于几乎每种Java EE API都有一个以上的实现,因此您必须自己研究和选择这些实现.

If you wish to load the library you will have to depend on a real API. Since there tends to be more than one implementation of just about every Java EE API you will have to research and choose these yourself.

查找博客帖子与此类似,以解决您的特定问题

Look for blog posts like this one to resolve your particular problem.

这篇关于在JSP 2.0中使用JSF 2.1时出错:无法从JAR文件读取TLD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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