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.
Note: All references to dsp:droplet
in this section describe the dsp:droplet
tag or its class. The term servlet bean refers to a specific kind of bean implemented by a dsp:droplet
tag.
Consider how the Oracle Commerce 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.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.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, it halts calls to
setParameter
andserviceParameter
, and instead records them as a list ofDropletActions
. 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.The
dsp:droplet
parses through eachsetParameter
andserviceParameter
method inDropletActions
:setParameter
directs thedsp:droplet
to set the specified request parameter to the recorded name (output
) 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
).
After the
dsp:droplet
finishes theDropletActions
list, servlet bean execution ends.