"lightbulb432" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> In a web application that loads resources expecting them to be available 
> on
> the classpath (e.g. ResourceBundle.getInstance("resource")), is there a 
> way
> to alter what locations the web context classloader includes?
>

Not from the configuration alone, unless you are happy to add it to the 
'common' or 'shared' loader (and, yes, the shared loader exists in TC 6, it 
just doesn't do anything by default).

Otherwise, the only way is to create a custom Loader that calls 
addRepository on the WebAppClassLoader with the external location (as a URL 
string).  Note that custom Loaders aren't as well supported as other custom 
classes at the moment, so this may require additional coding to get it to 
work (i.e. the parent classloader isn't automagically assigned).

> I'd like to add a URL to the search path of the web context classloader, 
> so
> that in the above example, resource.properties from some URL is seen by 
> the
> web application. I know that URLs can be made available to a classloader 
> by
> using URLClassLoader. However, I don't know how I can include the search
> path of that classloader in the web application's classloader provided by
> Tomcat. How can I do this?
>
> Thanks.
> -- 
> View this message in context: 
> http://www.nabble.com/Add-URLClassLoader-search-path-to-default-context-classloader-tp14458477p14458477.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> 




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to