For a CA Gen Web application is it possible to write code to access the HTML header in the toolset model to be able to find the id_token within the cookie or the header.
Release : 8.6
Component : CA Gen Workstation Toolset
The Action Diagram statements that can be coded in the Toolset are usually reserved for the application's business rules that apply regardless of the target platform of the application. Since access to the HttpServletRequest and HttpServletResponse objects is specific to Java/Web applications, this access was only offered through EABs and some User Exits.
It has now been verified that these objects can also be accessed through Inline Code. Inline Code has many benefits over EABs, especially since the code is kept with the model. Also, it is encouraged that all new "external" logic to be done with Inline Code instead of EABs, where possible. Some documentation references for Inline Code:
Attached is a model that provides two examples of using Inline Code in Java. The first example shows one way to modify the contents of a Repeating Group View (RGV). The other example shows how to access the HttpServletRequest object, execute methods on that object, and display the results of those methods. This model contains a Window-packaged application.
It should be generated/installed with the following Generation Options: JVM, <NONE>, JAVA, INTERNET, <NONE>, Local. After Assembling the application's .ear file, it should be deployed to your Application Server. The application can then be accessed with a URL similar to the following: http://<host>:<port>/<context>/trn1.jsp. When the application's window is first displayed, the listbox will be populated with example data.
If you click the "Modify RGV with Inline Code" pushbutton, the contents of the RGV will be modified by executing Inline Code in the pushbutton's event handler. If you click the "Query HttpServletRequest" pushbutton, the pushbutton's event handler will USE the access_httpservletrequest Action Block, which contains Inline Code to execute methods on the HttpServletRequest object. While this model does not contain a real world example, it is hoped that it at least provides a starting point to understanding how Inline Code might be used.