How to add TLD and Tag Lib files into a Maven's jar project

前端 未结 2 774
说谎
说谎 2021-02-05 17:54

I have a Maven project that is packaged as jar.

And I also have a Maven project that is packaged as war. This war project has a tld file and so

2条回答
  •  名媛妹妹
    2021-02-05 18:31

    The practice these days is to put the TLD files into the tag library JAR and let the class loader find them. Download the Apache JSTL JARs and see how they do it. I'd recommend following that convention. It'll simplify your app too, because you won't have to declare the TLD in your web.xml file: just put the JAR in your CLASSPATH and make sure that the URI in your .jsp matches that in the TLD.

提交回复
热议问题