Gen Example Model : INLINE CODE statement for Java
search cancel

Gen Example Model : INLINE CODE statement for Java

book

Article ID: 245582

calendar_today

Updated On:

Products

Gen Gen - Run Time Distributed Gen - Workstation Toolset Gen - Host Encyclopedia

Issue/Introduction

INLINE CODE for Java.
-  How to access the HttpServletRequest object, execute methods on that object, and display the results of those methods.
-  How to modify the contents of a Repeating Group View (RGV).

Environment

Release : 8.6

Component : Gen Workstation Toolset

Resolution

Inline Code has many benefits over EABs, especially since the code is kept with the model.  It is recommended that all new "external" logic to be done with Inline Code instead of EABs, where possible.
 
Here are a few links that might be useful pertaining to 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 an 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.  When clicking 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.  When clicking 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 does at least provide a starting point to understanding how Inline Code might be used for Java.
 
 

Attachments

1657288371171__inline.ief.zip get_app