This topic presents some considerations of which you need to be
aware when using remote request dispatcher.
- If an application expects parameters in certain encoding, the application
should set character encoding, as in a normal include, before the remote request
dispatch (RRD) occurs.
- ServletInputStream data of local server is not available to remote server.
The local server parses POST data prior to sending the RRD request to the
remote server and include parameters as request parameters. Multipart form
data is inaccessible to remote server. An UnsupportedOperationException is
created if the remote server attempts to obtain inputstream from the request.
- No access to original request reference on the remote server.
- Request and response wrappers created in the local server are not available
in remote server. This cannot be done due to ServletRequestWrappers and WebSphere® internal
ServletRequest objects not implementing Serializable.
- Request attributes need to be serializable.
- Class definition of attributes need to be available in both local and
remote servers.
- Request attributes are propagated to the remote server and back to the
local server.
- HTTP Sessions
- You cannot have cross session access between different Web applications
when Web applications are remote.
- When all Web applications are in a local server, an application can share
sessions across Web applications by storing the session in a table that is
accessible to multiple Web applications. This is not possible with RRD and
not recommended in local case either.
- Servlet Programming Model: You cannot access sessions in different Web
applications.
- Normal programming model in local case as well as remote case.
- In local mode, application can cache away reference and share the session
across the Web applications, which is not feasible in RRD case.
- A session object that is stored as request attribute is not available
on remote server as the Session class does not implement Serializable.
- Thread local variables that are set on the local server are not available
on the remote server.
- Not all methods defined on ServletContext object are available for the
RRD ServletContext object. See the SPI documentation for com.ibm.wsspi.rrd.context.RemoteServletContext
for details.
- The remote server does not have access to output of local server when
using RRD.
- Cookies and ServletRequestWrappers
If customer application wrappers
the HttpServletRequest.getCookies method and returns additional cookies or
removes cookies, the modified cookies are not sent to the remote server because
javax.servlet.http.Cookie does not implement Serializable. Cookies from the
original request headers are sent to the remote server.
- When you use Remote Request Dispatcher and its cache abilities through
dynamic cache, you do not receive the cache invalidations locally that occured
on the remote server. Thus, outdated data might display in responses to the
client. The DynaCacheEsi.ear file is available for installation
in the WAS_HOME/installableApps directory. Install the file before
starting any Remote Request Dispatcher-enabled applications that use dynamic
cache features. You must install the DynaCacheEsi.ear file to the
same virtual host on which the Remote Request Dispatcher applications are
installed.