eclipse 我的标签库中的错误 <%@ taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%>
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13991799/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error in my taglib <%@ taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%>
提问by Wael
When I developed my portlet and when i wrote my jsp page I used:
当我开发我的 portlet 和编写我的 jsp 页面时,我使用了:
<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0"%>
but eclipse show me an error telling me that it cannot find the tag lib descriptor for http://java.sun.com/portlet_2_0.
但是 eclipse 向我显示了一个错误,告诉我它找不到http://java.sun.com/portlet_2_0的标签库描述符。
How can I resolve this issue wihtout using tld files ?
如何在不使用 tld 文件的情况下解决此问题?
回答by Linh Lino
In my case, I am using Liferay Portal, so in order to avoid this error
I changed:
就我而言,我使用的是 Liferay Portal,因此为了避免此错误,我更改了:
<%@ taglib uri="http://java.sun.com/portlet_2_0"% prefix="portlet">
to
到
<%@ taglib uri="/WEB-INF/tld/liferay-portlet.tld" prefix="portlet" %>
and in file "WEB-INF/liferay-plugin-package.properties"; I added this line
并在文件“WEB-INF/liferay-plugin-package.properties”中;我添加了这一行
portal-dependency-tlds=/WEB-INF/tld/liferay-portlet.tld
which is suggested by a Liferay staff (Link)
这是 Liferay 工作人员建议的(链接)
回答by John
Remove the line
删除该行
<%@ taglib uri="http://java.sun.com/portlet_2_0"% prefix="portlet">
and paste this line:
并粘贴这一行:
<%@taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
Then, in WEB-INF/tld
folder put these files: aui.tld
, liferay-portlet.tld
, liferay-portlet-ext.tld
, liferay-security.tld
, liferay-theme.tld
, liferay-ui.tld
, liferay-util.tld
.
然后,在WEB-INF/tld
文件夹中放入这些文件:aui.tld
, liferay-portlet.tld
, liferay-portlet-ext.tld
, liferay-security.tld
, liferay-theme.tld
, liferay-ui.tld
, liferay-util.tld
.
回答by dcalap
If you add this to the web.xml in the WEB-INF folder it will remove the Eclipse error message.
如果您将此添加到 WEB-INF 文件夹中的 web.xml,它将删除 Eclipse 错误消息。
<web-app>
<taglib>
<taglib-uri>http://java.sun.com/portlet_2_0</taglib-uri>
<taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
</taglib>
</web-app>
Hope it helps.
希望能帮助到你。
回答by VHS
This error just means that Eclipse is unable to find a tag library descriptor (TLD) that resolves the given (http://java.sun.com/portlet_2_0) tag URI. You can download the TLD corresponding to your portal container (Gatein, Pluto, Liferay, etc) from GitHub and place it in WEB-INF folder. Gatein specific tld can be found here. Also, make sure that you have the portlet_2.0 jar in your project path.
此错误仅表示 Eclipse 无法找到解析给定 ( http://java.sun.com/portlet_2_0) 标记 URI的标记库描述符 (TLD) 。您可以从 GitHub 下载与您的门户容器(Gatein、Pluto、Liferay 等)对应的 TLD,并将其放在 WEB-INF 文件夹中。Gatein 特定的 tld 可以在这里找到。此外,请确保您的项目路径中有 portlet_2.0 jar。
回答by Benoit Wickramarachi
You can download portlet-2.0.jarand add it to your project path. But if you are developping for Liferay I would recommand you to use the liferay-portlet.tld
which has the portlet 2.0 specification.
您可以下载portlet-2.0.jar并将其添加到您的项目路径中。但是,如果您正在为 Liferay 进行开发,我建议您使用liferay-portlet.tld
具有 portlet 2.0 规范的 。