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’s cohesive with the expectations of open parameters.
Note: All references to dsp:droplet
in this section are describing the droplet
tag or the class that describes it. The term servlet bean refers to a specific kind of bean implemented by a dsp:droplet
tag.
Consider how the ATG platform processes this example:
<dsp:droplet name="/atg/dynamo/droplet/ForEach">
<dsp:param name="array" bean="/samples/Student.subjects"/>
<dsp:oparam name="output">
<p><dsp:valueof param="element"/>
</dsp:oparam>
</dsp:droplet>
The
dsp:droplet
tag is called.The
dsp:droplet
allows its body to be executed once. During that execution, the nested input parameter tags (in this case, justarray
) pass their information back todsp:droplet
, which uses it to construct a table of input parameter names (array
) and values (Reading
;Writing
;Arithmetic
). The open parameter tags are ignored during this phase.The
dsp:droplet
finds the servlet bean referenced by thedsp:droplet
“name="
property (forEach
) and calls the servlet bean’sservice()
method with the input parameter values collected during step #2 (Reading
;Writing
;Arithmetic
).As the servlet bean executes, the droplet halts calls to
setParameter
andserviceParameter
, and instead records them as a list ofDropletActions
. These methods are organized in a manner that’s readable by the open parameters that process them and are made available to open parameters for execution.The
dsp:droplet
parses through eachsetParameter
andserviceParameter
method inDropletActions
:setParameter
directs thedsp:droplet
to set the specified request parameter to the recorded name (ouput
) and value (element
).serviceParameter
instructs thedsp:droplet
to allow its body to be executed. This causes the related open parameter to run (element
equalsReading
;Writing
;Arithmetic
).
Once the
dsp:droplet
finishes theDropletActions
list,droplet
execution ends.