The Ajax proxy is distributed as an optional Web archive file (WAR) that can be installed directly into an application or combined with an existing application enterprise archive (EAR) file. The usage depends on your goals.
If you are developing an application that uses Ajax that must support cross site scripting because you are accessing data from one or more remote sites, you might embed the Ajax proxy WAR file as part of your application. If you have multiple applications that are accessing the same remote site, you might deploy the Ajax proxy as a standalone WAR file, and allow multiple applications to access it.
As a servlet, the proxy can be embedded in your Java EE application and deployed with the application. Embedding the proxy with the application supports proxy deployment with the application in a ready-to-run configuration. You might choose to embed the Ajax proxy in your application if you are building an application that combines the content from one or more service endpoints in an Ajax-based application.
As a servlet, the proxy can run as a standard Web application. Other applications can use the proxy to broker requests.
The first step is locating the Ajax proxy WAR file. Depending on how you obtained and are viewing the documentation, there are two places the file can be located.
Linux® and UNIX®:
<ECLIPSE_HOME>/plugins/com.ibm.ws.ajaxproxy.runtime_1.0.1.0/AjaxProxy.war |
Windows®:
<ECLIPSE_HOME>\plugins\com.ibm.ws.ajaxproxy.runtime_1.0.1.0/AjaxProxy.war |
Linux and UNIX: /opt/WebSphere/AppServer |
Windows:
c:\WebSphere\AppServer |
Linux and UNIX:
/opt/WebSphere/AppServer/web2fep/AjaxProxy/AjaxProxy.war |
Windows:
c:\WebSphere\AppServer\web2fep\AjaxProxy\AjaxProxy.war |
Use any Eclipse 3.2.X, 3.3.X, or higher with the Web Tools Project 2.5 or higher, or Rational Application Developer, version 7.0 or higher, to import the WAR file. Complete the following steps:
When the import process completes, The Ajax proxy will be imported as a WAR file. You can associate the WAR file with another EAR project or treat the WAR file as a standalone web application.
The proxy-config.xml file is located in the WEB-INF/ directory of the AjaxProxy.war file and controls how the proxy behaves when a client side request is passed to the proxy. The proxy-config.xml file is loaded during the servlets initialization phase, you must restart the servlet for changes to take effect. The section, WEB-INF/proxy-config.xml file discusses how to control the behavior of the proxy.