The Java version of Web Generation provides two mechanisms for accessing the HttpServletRequest object: user exits or external action blocks.
Accessing through the following set of user exits under the CA Gen install directory hierarchy:
An object named runtimeObject is exposed in the above set of user exits. In a web context, the HttpServletRequest object will be available as the runtimeObject. To utilize this object as an HttpServletRequest object, add the following to the import section of the user exit you are modifying:
import javax.servlet.*; import javax.servlet.http.*;
Add the following code to any method that uses the object, if:
((runtimeObject != null) && (runtimeObject instanceof HttpServletRequest)) {
HttpServletRequest request = (HttpServletRequest) runtimeObject;
/**
* User-written code should be inserted here
*/
}
Accessing through External Action Blocks:
To use the HttpServletRequest object
// User-written code should be inserted here HttpServletRequest req = (HttpServletRequest)(iefRuntimeParm2.getRequest());
String user = req.getRemoteUser();
globdata.getStateData().setUserId(user);
w_oa.exservletreq_servletrequest_scheme.set(req.getProtocol());
Note: CA Gen global data (globdata) is available here but CA strongly recommends that users do not use it, as it is subject to change.
|
Copyright © 2013 CA.
All rights reserved.
|
|