Wednesday 27 July 2016

Behind the Scenes | ATG Droplet [Servlet Bean] Internal Processing

Today found some interested information about ATG droplet processing.


When a JSP executes a servlet bean, the dsp:droplet cycles through its code internally several times in order to arrange the servlet bean code in a manner that is cohesive with the expectations of open parameters.

For example below code.
<dsp:droplet name="/atg/dynamo/droplet/ForEach"> 
  <dsp:param name="array" bean="/samples/Employees"/>
     <dsp:oparam name="output">
        <dsp:valueof param="element.name"/>
     </dsp:oparam>
 </dsp:droplet>

Processing Steps :

1. The dsp:droplet tag is called.

2. dsp:droplet allows its body to be executed once. During that execution, the nested input parameter tags (in this case, just array) pass their information back to dsp:droplet, which uses it to construct a table of input parameter names (array) and values. The open parameter tags are ignored during this phase.

3. dsp:droplet finds the servlet bean referenced by the dsp:droplet “name=" property (forEach) and calls the servlet bean’s service() method with the input parameter values collected during step 2.

4. As the servlet bean executes, it halts calls to setParameter and serviceParameter, and instead records them as a list of DropletActions. These methods are organized in a manner that is readable by the open parameters that process them and are made available to open parameters for execution.

5. The dsp:droplet parses through each setParameter and serviceParameter method in DropletActions.
  • setParameter directs the dsp:droplet to set the specified request parameter to the recorded name (ouput) and value (element).
  • serviceParameter instructs the dsp:droplet to allow its body to be executed. This causes the related open parameter to run.
6. After the dsp:droplet finishes the DropletActions list, servlet bean execution ends.

No comments:

Post a Comment