Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I configure OC4J to locate a URL resource by making a JNDI lookup ?

0
Posted

How do I configure OC4J to locate a URL resource by making a JNDI lookup ?

0

You have to define the resource in the deployment descriptor e.g. you are trying to access the URL resource from a web application then you have to have the following entry in the web.xml url/MyURL java.net.URL Container Shareable b) You have to map the resource name e.g. url/MyURL into a location in your vendor specific deployment descriptor e.g. orion-web.xml as follows: c) Now you can lookup the URL resource and connect using the following code: HttpURLConnection connection = null; Context context = new InitialContext(); URL url = (URL) context.lookup (“java:comp/env/url/MyURL”); connection = (HttpURLConnection)url.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.