Hi,

you can set in you startApplicationServer file a system property with config 
path. When it starts server you'll have to read this properties file in your 
config path in a ServletContextListener . With a example is more easy to 
explain :

WebLogic startWebLogic.cmd :

.....

set PATH_APLICACION="./applications"
...
%JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% 
-Dweblogic.Name=%SERVER_NAME% 
-Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE% 
-Djava.security.policy="%WL_HOME%\server\lib\weblogic.policy" 
-DDIR_CONFIG_APP="%PATH_APLICACION%\app_cfg"  weblogic.Server

ServletContextListener  :

public class InitializatorApp implements ServletContextListener {
...
...
public void contextInitialized(ServletContextEvent event) {

configDir = System.getProperty("DIR_CONFIG_APP");
...
config = new Properties(configDir + "YOUR_CONFIG_FILE");
...
}

}

Hope helps you



-----Original Message-----
From: David Delbecq [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 28, 2006 11:48 AM
To: Struts Users Mailing List
Subject: Re: Fwd: [OT] How to specify classpath for an application


It's rather not possible in general, The .war is supposed to be a 
'complete' application, config included. If you load the ressources 
using the classloader, you can still use 'tricks' that depend on 
container specific behaviour, but that is not recommanded.

The best way if you want your user not to have to play thmeself with 
.war content is to provide a ant script that will take a config/ 
directory and inject it in the .war, so the user easily regenerate the 
war avec config change.


Pankaj Gupta wrote:
> ---------- Forwarded message ----------
> From: Pankaj Gupta <[EMAIL PROTECTED]>
> Date: Jun 28, 2006 11:03 AM
> Subject: [OT] How to specify classpath for an application
> To: user@struts.apache.org
>
> Hi All,
>
> I want to specify a config folder in my classpath which will not be 
> part of
> my war file. Can you please suggest how can I do that? I want to place my
> config files outside the war file for anyone to modify it.
>
> regards,
> Pankaj
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

***************************************************************************************************
The information in this email is confidential and may be legally privileged 
Access to this email by anyone other than the intended addressee is 
unauthorized. If you are not the intended recipient of this message, any 
review, disclosure, copying, distribution, retention, or any action taken or 
omitted to be taken in reliance on it is prohibited and may be unlawful. If you 
are not the intended recipient, please reply to or forward a copy of this 
message to the sender and delete the message, any attachments, and any copies 
thereof from your system.
***************************************************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to