Tuesday, 1 May 2012

dsp:droplet tag with example

dsp:droplet

dsp:droplet tag is used to invoke a servlet bean, i.e, atg droplet. The syntax of dsp:droplet is as shown below.


<dsp:droplet [var-spec] name="servlet-bean" >
...
</dsp:droplet>

where Name is the servlet bean to be invoked and var-spec can be one of these attributes

  • var - defines a EL variable which holds the servlet bean parameters and values, the default scope of this variable is page, you can set it to session or application.
  • id - defines a scripting variable, which can accessed using scriptlets and expressions.

Example of dsp:droplet


<dsp:droplet var="cont" name="/atg/dynamo/droplet/ForEach">

<dsp:param bean="/com/Contest.winners" name="array"/>

<dsp:oparam name="outputStart">

Contest Winners

</dsp:oparam>

<dsp:oparam name="output">

<c:out value="${cont.element}"/>

</dsp:oparam>

</dsp:droplet>


In the above example, the ForEach (predefined ATG droplet) is invoked, a parameter has been passed to the ForEach as an array. The ForEach droplet iterates the array and the iterated element is diplayed using c:out . To be simple, the elements of Contents.winners are iterated using ForEach droplet and printed using c:out

1 comment:

  1. Wonderful & nice blog post for solution helful sit. plz sir join tutorialsolution dot com & given Answer & question - thank sir

    ReplyDelete

Thanks for your comment. Please be genuine, do not spam, Comments posted with links will be considered as spam.