Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Setting up a URL resource in Tomcat JNDI

843841Oct 19 2005 — edited Oct 20 2005
I need to set up a value of type java.net.URL in server.xml so that it's accessible via JNDI from servlets running under Tomcat.

I.e., I need to set up a value that I can get in the code like this:

URL url = (URL) initialContext.lookup("url/configURL");

How do I do that? I tried the setting below, but it does not seem to work for the type java.net.URL. Please help. Thanks!

<Resource auth="Container" name="url/configURL" scope="Shareable" type="java.net.URL"/>
          
          <ResourceParams name="url/configURL">
                          <parameter>
                              <name>spec</name>
                              <value>file:///C:/conf_files</value>
                          </parameter>
          </ResourceParams>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 17 2005
Added on Oct 19 2005
3 comments
230 views