DevPortal

How do I configure URL Resources for J2EE Applications?


Table of Contents


What can I do with URL Resources?

Using URL Resources you can assign JNDI name aliases to Web pages accessed by an application. Rather than opening URLs directly, you can resolve them using JNDI.

How do I use resource-config.xml to configure URL Resources?

You can configure a URL Resource using resource-config.xml by adding a url-resource tag under the url-resources tag. The resource-config.xml appears as below:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resource-service PUBLIC '-//Pramati Technologies //DTD Pramati Resource Service//EN'
'http://www.pramati.com/dtd/pramati-resource-service.dtd'>
<resource-service>
  <resources>
    <default-resources> </default-resources>
    <datasources> </datasources>
    <connection-factories> </connection-factories>
    <mail-resources> <mail-resources>
    <url-resources>
      <url-resource name="URL1" description="nodesc" url="http://www.pramati.com"/>
    </url-resources>
    <jms-adapters> </jms-adapters>
  <resources>
</resource-service>

How do I use Resource Shell to add URL Resources?

To add a URL Resource using the resource shell, on the resourceadmin:> prompt, enter: resourceadmin:> add_urlresource

Following are the are two ways to add a URL Resource using add_urlresource:

Interactive

To use the interactive mode, enter add_urlresource, and press Enter. This asks for all the required fields one after the other. No special flag is required for this mode.

Enter the following values needed for the command resourceadmin:> add_urlresource

resourceadmin>  - jndi name * #myURL
resourceadmin>  - url value * #www.pramati.com
Creating URL Resource myURL
URL Resource [myURL] started
Created URL Resource myURL successfully
Added URL resource [myURL]

Note: Fields followed by * are mandatory. Press Enter for the default values. Typing 'q' and pressing Enter at any point cancels the current command.

Non-Interactive

To use the non-interactive mode, enter add_urlresource. All the required attributes - the JNDI name and the URL value in this case - have to be specified. All optional attributes have default values that can be modified. There are three ways in which you can specify the fields:

How do I use the Console to configure URL Resources?

To configure a URL Resource using the Console, select Configure > Resources. This displays the Resources screen. If there are URL Resources added earlier, the URL Resources section displays the following details:

Table 1: URL Resource details

FieldsDescription
NameThe JNDI name of the URL Resource. This is a mandatory field and must be unique.
URLThis is a valid URL address, for example http://www.pramati.com.
AddUse Add to add a new URL Resource.
DeleteUse Delete to delete a URL Resource.

How do I add URL Resources?

To add a URL Resource:

  1. Click Add under the URL Resources section.
  2. Specify here the following information:

    Table 2: Details for adding a URL Resource

    FieldsDescription
    NameEnter here a unique name for the URL Resource. This is a mandatory field.
    URLEnter here a valid URL address, say www.pramati.com. This is a mandatory field.
  3. Click Save. This adds the URL Resource, and takes you to the Resources screen.

How do I delete URL Resources?

Select the URL Resource to be deleted using the check box on the Resources page and click Delete. This deletes the selected URL Resource.


Related Topics:

© Pramati Technologies 2007 Runs on Pramati Server | Feedback | Legal