Configuring the AJAX proxy

Use the AJAX proxy to broker client requests from multiple domains while using AJAX.

Create a Web 2.0 enabled Web project ensuring that you have enabled the AJAX proxy facet.

When you create a Web project with the AJAX proxy facet enabled, the AJAX proxy configuration file, proxy-config.xml, is automatically generated in the WEB-INF folder. To configure the AJAX proxy:

  1. Double-click proxy-config.xml to open it in the editor.

  2. Modify the proxy-config.xml file to define URI context paths and policies that the proxy supports.

The proxy-config.xml file defines the policy by which URI requests are supported to pass through the proxy and how context paths from the client are mapped to the URI on a server. The proxy-config.xml file can be modified by an editor and needs to be in location on the classpath that the proxy servlet can locate. Changes to the proxy-config.xml file are not dynamic; you need to restart the servlet for the changes to take affect.

 

Related concepts

What is Ajax?

The importance of the proxy for Ajax