简体   繁体   English

IBM Websphere Portal 7中的portlet标签库的定义JAR在哪里?

[英]Where is the defining JAR of the portlet taglibs in IBM Websphere Portal 7?

I'm trying to build portlets for websphere in Eclipse Juno. 我正在尝试在Eclipse Juno中为Websphere构建portlet。 Everything works so far, building and running the WAR files on WPS7 is ok. 到目前为止,一切正常,在WPS7上构建和运行WAR文件是可以的。

But in my JSP editor I get a lot of warnings: 但是在我的JSP编辑器中,我收到很多警告:

Can not find the tag library descriptor for "/WEB-INF/tld/portal.tld"

In my JSP file I'm using the usual taglib line: 在我的JSP文件中,我使用通常的taglib行:

<%@taglib uri="http://java.sun.com/portlet" prefix="portlet"%>

Now I wonder if I have to bring the actual JAR file that defines this tag into my eclipse or if there is something else that I missed. 现在,我想知道是否必须将定义此标签的实际JAR文件带入eclipse中,或者是否遗漏了其他内容。

I'm using a Portal 8 installation but the structure should be similar. 我正在使用Portal 8安装,但结构应该相似。

I found a jar containing portal.tld at [Portal Install root]\\Portal Server\\base\\wp.engine.tags\\shared\\app\\wp.engine.tags.jar 我在[门户安装根目录] \\ Portal Server \\ base \\ wp.engine.tags \\ shared \\ app \\ wp.engine.tags.jar中找到了一个包含portal.tld的jar

Though as a more complete solution you might want to include the whole base folder into your classpath. 尽管作为一种更完整的解决方案,您可能希望将整个基本文件夹包括在类路径中。 The server runtime RAD adds to my portlet project include lots of jars from that folder as part of the basic setup. 作为基本设置的一部分,服务器运行时RAD添加到我的portlet项目中,包括该文件夹中的许多jar。 It also includes many jars from [WAS Install root]\\App Server\\plugins. 它还包括[WAS安装根目录] \\ App Server \\ plugins中的许多jar。 Since you're just using Eclipse instead of RAD (which would help manage the Portal server jars) you'll probably want to create a user library to manage all these jars. 由于您只是使用Eclipse而不是RAD(这将有助于管理Portal服务器jar),因此您可能需要创建一个用户库来管理所有这些jar。

The reason you are getting this error message has nothing to do with the taglib declaration you had quoted. 您收到此错误消息的原因与引用的taglib声明无关。 The latter refers to the standard Portlet tag library (JSR-168), whereas the former has to do with WebSphere Portal's proprietary tags, needed to use WebSphere Portal-specific facilities. 后者指的是标准Portlet标记库(JSR-168),而前者则与使用WebSphere Portal特定功能所需的WebSphere Portal专有标记有关。

I am guessing that portal.tld is referred-to by your web.xml . 我猜您的web.xml引用了portal.tld

When developing portlets under RAD, IBM's RAD plugins ensure that this TLD file is known to the JSP compiler, by virtue of attaching the WebSphere Portal runtime - in its entirety - to the Dynamic Web Project's classpath. 在RAD下开发portlet时,IBM的RAD插件通过将WebSphere Portal运行时(整体上)附加到Dynamic Web Project的类路径来确保JSP编译器知道该TLD文件。

Under Eclipse Juno, this isn't done for you. 在Eclipse Juno下,这不是为您完成的。 You will have to find the JAR file that contains it (which might vary from one WebSphere Portal release to another) and add it to your compile-time classpath. 您将必须找到包含它的JAR文件(从一个WebSphere Portal版本到另一个版本可能有所不同),并将其添加到编译时类路径中。

Having said that, you may want to consider why you need that web.xml declaration in the first place. 话虽如此,您可能要考虑为什么首先需要该web.xml声明。 With Portal 7.0, most of IBM's tag libraries can be referred to by their URI's, rather than having to specifically mention the TLD file. 使用Portal 7.0,大多数IBM的标记库都可以通过其URI来引用,而不必特别提及TLD文件。

In RAD/Eclipse, assuming you have the Portal 8 Stubs and Developer Tools installed, you can go to Project->Project Properties -> Java Build Path, to the Libraries tab, Go to Add Library -> Server Runtime , and you should see "Websphere Portal 8" or whichever version you have installed ... once that library is added your URI problems should be resolved.This essentially adds every jar file in the entire portal installation to the build path. 在RAD / Eclipse中,假设您已安装了Portal 8存根和开发人员工具,则可以转到Project-> Project Properties-> Java Build Path,转到Libraries选项卡,转到Add Library-> Server Runtime,您应该看到“ Websphere Portal 8”或您安装的任何版本...添加该库后,您的URI问题应得到解决。这实际上是将整个门户网站安装中的每个jar文件添加到构建路径。 If you do not have the stubs and development tools installed, or if you are using another IDE, you will need to add the jar files manually to the build path .... 如果您没有安装存根和开发工具,或者使用的是其他IDE,则需要将jar文件手动添加到构建路径中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM