此内容没有您所选择的语言版本。

3.8. Deploy Tag Library Descriptors (TLDs) in a Custom Module


Summary

If you have multiple applications that use common Tag Library Descriptors (TLDs), it may be useful to separate the TLDs from the applications so that they are located in one central and unique location. This enables easier additions and updates to TLDs without necessarily having to update each individual application that uses them.

This can be done by creating a custom JBoss EAP 6 module that contains the TLD JARs, and declaring a dependency on that module in the applications.
Prerequisites

  • At least one JAR containing TLDs. Ensure that the TLDs are packed in META-INF.

Procedure 3.7. Deploy TLDs in a Custom Module

  1. Using the Management CLI, connect to your JBoss EAP 6 instance and execute the following command to create the custom module containing the TLD JAR:
    module add --name=MyTagLibs --resources=/path/to/TLDarchive.jar
    Copy to Clipboard Toggle word wrap
    If the TLDs are packaged with classes that require dependencies, use the --dependencies=DEPENDENCY option to ensure that you specify those dependencies when creating the custom module.
    When creating the module, you can specify multiple JAR resources by separating each one with :. For example, --resources=/path/to/one.jar:/path/to/two.jar
  2. In your applications, declare a dependency on the new MyTagLibs custom module using one of the methods described in Section 3.2, “Add an Explicit Module Dependency to a Deployment”.

    Important

    Ensure that you also import META-INF when declaring the dependency. For example, for MANIFEST.MF:
    Dependencies: com.MyTagLibs meta-inf
    Copy to Clipboard Toggle word wrap
    Or, for jboss-deployment-structure.xml, use the meta-inf attribute.
Result

In your applications you can use TLDs that are contained in the new custom module.

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat