How to manage Tomcat 6 libraries into subfolders under %TOMCAT_HOME%/lib?

耗尽温柔 提交于 2019-12-23 09:43:46

问题


I use Tomcat 6.0.20 and JDK 1.6.0.13.

How can I load libraries from sub-folders of "%TOMCAT_HOME%/lib/" without taking the .jars out of sub-folders and putting them straight into "%TOMCAT_HOME%/lib/"?

The reason I want to do this, is because many apps are going to be sharing lots of libraries.

So, for the sakes of organization I want to store them into folders as such:
%TOMCAT_HOME%/lib/novell/.jar
%TOMCAT_HOME%/lib/mail/
.jar
%TOMCAT_HOME%/lib/upload/*.jar
etc.

How would I go about this? And please provide an example. Do I use setclasspath.bat, catalina.properties or something completely different? Thanks in advance.


回答1:


Define those paths in shared.loader property of /conf/catalina.properties file.

E.g.

shared.loader = ${catalina.home}/lib/novell/*.jar, ${catalina.home}/lib/mail/*.jar, ${catalina.home}/lib/upload/*.jar

[Edit] optionally you can also use the common.loader property for this. See what has your preference.



来源:https://stackoverflow.com/questions/1675255/how-to-manage-tomcat-6-libraries-into-subfolders-under-tomcat-home-lib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!