Ajax Proxy - Context path mappings

 

+

Search Tips   |   Advanced Search

 

Use a context path mapping to map a particular context path to a particular target URL. The proxy resolves context path mappings prior to applying the matching access policy.

To work with context path mappings, you work with the mapping element.

The sample mapping element shown below maps requests that contain the context path /ibmproducts to the URL...

This means that if the incoming proxy URL is...

...the proxy forwards the request to...

For more details about the proxy URL format and the usage of context path mappings refer to the section about the programming model.

<mapping contextpath="/ibmproducts" url="http://www.ibm.com/products"/>

You can also define generic context path mappings which are not tied to a specific URL pattern. You do this by specifying the asterisk as a wild card: url="*". Example:

<mapping contextpath="/proxy" url="*"></mapping>
However, if your application needs to connect to only a few external systems, for example to one external REST service that provides the application data, it is more beneficial to use a specific context path mapping.

The current servlet based implementation of the proxy requires that for each defined mapping element there is a corresponding servlet mapping. This is defined in web.xml and maps all requests that address the specified context path to the proxy servlet. Applied to the examples discussed above, this means that there must be a servlet mapping for the context path "/ibmproducts", or "/proxy" respectively, that references the proxy servlet.


Parent topic:

The proxy-config.xml file


Related reference


Access policies
IP filtering
General configuration parameters
Examples of AJAX proxy configurations