Liferay Taglib导入不在JSP中工作 [英] Liferay Taglib import not working in JSP

查看:108
本文介绍了Liferay Taglib导入不在JSP中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的一个JSP页面中导入liferay标记库时遇到问题,不知道我做错了什么。我在之前的项目中做了完全相同的事情,但现在由于某种原因它没有用。

I'm having trouble importing the liferay taglibs in one of my JSP pages, no idea what I'm doing wrong. I did the exact same thing in previous projects, but now for some reason it's not working.

我要导入的代码:

<%@ taglib uri="http://liferay.com/tld.ui" prefix="liferay-ui" %>

我得到的语法错误:

The absolute uri: http://liferay.com/tld.ui cannot be resolved in either web.xml or the jar files deployed with this application

我试图广泛地讨论这个问题,但无济于事。 liferay的可怕文档(或缺少文档)也没有什么大帮助。

I tried to google this problem quite extensively, but to no avail. The horrible documentation (or lack thereof) for liferay is also not a big help at all.

提前感谢您的帮助!

推荐答案

taglib URI从以下位置(按顺序)解析:

The taglib URI gets resolved from the following places(in the order):


  1. 如果容器符合Java EE平台,则标记库是Java EE平台的一部分。目前包括 JSTL和JSF标记库库。

  2. web.xml中的T​​aglib Map ,web.xml可以包含URI和TLD的资源路径的显式映射。

  3. WEB-INF / lib中的JAR文件中的TLD WEB-INF下的TLD

  4. Container支持TLD

  1. If the container is Java EE platform compliant, the tag libraries that are part of the Java EE platform. This currently includes JSTL and JSF Tag Library libraries.
  2. Taglib Map in web.xml, the web.xml can include an explicit map of URI's and TLD's respource paths.
  3. TLDs in JAR files in WEB-INF/lib and TLDs under WEB-INF
  4. TLD's supported by Container

在这种情况下,请检查以下情况:
1)如果在WEB-INF中存在对liferay实现的jar文件/ lib包含 jar / META-INF 中的TLD,将使用 http://liferay.com/tld.ui URI。
2)如果没有jar文件且jar文件外存在 liferay-ui.tld ,请在web.xml中添加URI映射entrey,如下所示:

In you case, check the following cases: 1) If jar file realted to liferay exists in WEB-INF/lib containing a TLD in jar/META-INF which will be defined with http://liferay.com/tld.ui URI. 2) If there is not jar file and the liferay-ui.tld exists outside the jar file, add the URI mapping entrey in your web.xml like below:

<taglib>
    <taglib-uri>http://liferay.com/tld/ui</taglib-uri>
    <taglib-location>/WEB-INF/tld/liferay-ui.tld</taglib-location>
</taglib>

这篇关于Liferay Taglib导入不在JSP中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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