将外部目录添加到 Tomcat 类路径 [英] Adding an external directory to Tomcat classpath

查看:30
本文介绍了将外部目录添加到 Tomcat 类路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 C: 驱动器中有一个文件夹为 C:app_configjava_app此文件夹包含一些特定于语言环境的属性文件.

I have a folder in my C: drive as C:app_configjava_app This folder contains some locale specific property files.

我有一个 java 类 (PrjPropertilesLocator),它在 web 应用程序启动时根据默认语言环境加载属性文件.我的 web 应用程序在 tomcat 中运行.问题是我应该如何在 tomcat 类路径中设置这个目录 C:app_configjava_app 以便它对 PrjPropertilesLocator 类中的 ResourceBundle 可用.有没有办法可以专门为需要它的单个 Web 应用程序设置此文件夹.我不想将属性文件放在 WEB-INF/classes 文件夹中.

I have a java class (PrjPropertilesLocator) that loads the property files based on default locale on the startup of the web App.My web application is running inside tomcat. The problem is how should i set this directory C:app_configjava_app in the tomcat classpath so that this becomes available to the ResourceBundle inside the PrjPropertilesLocator class. Is there a way i can set this folder specifically for a Single web app that needs it.I do not want to put the property files inside WEB-INF/classes folder.

在 weblogic 上,这运行良好.我在其启动脚本之一中设置了 weblogic 类路径中的目录,并且它工作正常.但是在 Tomcat 上,我尝试将它放在 startup.bat 中,也放在 setclasspath.bat 中,但未能成功.

On weblogic this runs fine.I set the directory inside the weblogic classpath in one of its startup scripts and it works fine. But on Tomcat i tried putting it in startup.bat also in setclasspath.bat, but was not able to do so successfully.

推荐答案

只需在 /conf/的 shared.loadercommon.loader 属性中指定即可catalina.properties.

Just specify it in shared.loader or common.loader property of /conf/catalina.properties.

这篇关于将外部目录添加到 Tomcat 类路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆