You use a context path mapping to map a particular context
path to a 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. For example, the following sample mapping
element maps requests that contain the context path /ibmproducts
to the URL http://www.ibm.com/products:
<mapping contextpath="/ibmproducts" url="http://www.ibm.com/products"/
This means that if the incoming proxy URL is http://mymashups.com/mum/ibmproducts/us/en,
the proxy forwards the request to http://www.ibm.com/products/us/en.
For more details about the proxy URL format, see URL
format and examples.
You can also define generic context path mappings
that are not tied to a specific URL pattern. You do this by specifying
the asterisk as a wild card: url="*",
<mapping contextpath="/proxy" url="*"
However, if your application needs to connect only to a few external systems,
for example to one external REST service that provides the application
data, you should use a specific context path mapping.
Note: The current servlet-based implementation of the proxy requires
a corresponding servlet mapping for each defined mapping
element, as defined in plugin.xml,
located in the proxy plug-in. This implementation 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",
respectively, that references the proxy servlet.
Parent topic: Configuring
the HTTP proxy for AJAX applications.