English 中文(简体)
JSP taglib in a JAR file Packd in an EAR file
原标题:JSP taglib in a JAR file packaged in an EAR file

我的情况如下:

  • taglib.jar: A custom JSP taglib packaged as a JAR file. The TLD file is /META-INF/taglib.tld.
  • webapp.war: A web application with JSP files that use the tags provided by taglib.jar.
  • app.ear: A J2EE application which contains webapp.war and other WAR files.

我想在<代码>app.ear/code>中包装一个taglib.jar,这样,联合执行项目在webapp.war上的卷宗和其他WAR档案都能使用其标记。 我在联合调查组档案中尝试了以下指示,但没有成功:

  • <%@ taglib uri="/taglib.jar" prefix="xxx" %>
  • <%@ taglib uri="taglib.jar" prefix="xxx" %>

是否有可能将联合调查组的试卷纳入欧洲复兴开发银行的档案? 如果是的话,那么在<代码>uri <>/code>中,我应当具体说明<代码>的属性?

<>说明: 当然,我可以把每个世界研究协会档案的<条码>>>>>.jar列入每个世界研究协会文件,但这只是我试图避免的。

<><>Context: 我在JBoss 4.2.3上部署了欧洲重建机构档案。

<><>Edit>: 我担心这一点是不可能的,特别是因为我读了。 http://maven.apache.org/plugins/maven-war-plugin”rel=“nofollow” Maven WAR plugin documentation :

有时,必须将联合开展的活动清单纳入世界反贪局(......)之中,以便它能够像对口图书馆一样适当开展工作。

最佳回答

这是不可能的。 最好的办法是在欧洲重建机构档案中包装taglib.jar,并在/WEB-INF上复制TLD文件。

问题回答

The jar taglib s can be only present under WEB-INF/lib. The container might provider some custom way to configure the commonly used tld. To achieve the same in JBOSS, this is the way

The JspServlet supports a new engineOptionsClass that allows the options implementation to be replaced. The default setting now uses the jboss specific JspServletOptions:

engineOptionsClass org.jboss.web.tomcat.tc5.jasper.JspServletOptions

which in turn uses a custom tag lib descriptor cache org.jboss.web.tomcat.tc5.jasper.TagLibCache that loads tag libs from jars in the tomcat sar conf/tlds.

This is an old topic but I want to share my solution: On eclipse right-click with mouse on the project, export as a jar with the option "Export generated class files and resources" and give a name to it (ex.customtags.jar). Open the packaged .jar with 7Zip and we should see a structure similar to the following:

  • com
  • META-INF
  • webapp
  • .classpath

http://www.un.org/Depts/DGACM/index_french.htm

After changing this jar add this to the webappWEB-INFlib folder of the project you want to use the taglib. On the jsp file put the following:

这样做应当只是罚款!

Regards, MS





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签