u can refer to the following droplet , it uses both list and array
<param name="items" value="param:product.childSKUs">
<!-- the product param is already defined in this scope so we do not need to set it -->
<!-- Now iterate over each of the CommerceItems to display the prices -->
<param name="array" value="param:element">
<param name="elementName" value="pricedItem">
<valueof param="pricedItem.auxiliaryData.catalogRef.displayName"></valueof> -
<!-- Toggle a different display depending if the item is on sale or not -->
<param name="value" value="param:pricedItem.priceInfo.onSale">
<valueof param="pricedItem.priceInfo.amount" currency>no price</valueof>
List price for <valueof param="pricedItem.priceInfo.listPrice" currency>no price</valueof>
on sale for <valueof param="pricedItem.priceInfo.salePrice" currency></valueof>!
Thanks for the reply. What I meant is to construct the list/array parameters in the jsp. Not to pass an existing list /array to the jsp.
For example, I should be able to pass firstName, lastName, zipCode, address1 etc from the jsp as a list to the droplet with a name say 'param'
Inside the droplet it should be accessible as param, param or through param.iterator()
In above drooplet childSKUs in a collection that we are passing as input param and rendering in droplet. You can follow the same approach and you can pass your own values like, you can maitain a map/set/list/array type property of a component and pass to droplet as a bean value.
There may be better approach of your requirement. So is it possible to elaborate the requirement?
Whats the need for passing totally different kind of attributes to the droplet as an array ? Isnt it a bad coding practice? It would be more of an assumption that param is firstname, param is lastname etc.,instead it would be good pass them as individual params themselves to the droplet
<dsp:param name="firstname" value="whatever"/>
<dsp:param name="lastname" value="somethingelse"/?
etc., and fetch them as different variables in Droplet. Or the component which provides the firstName, lastName, etc to the JSP - may be a Formhandler or another Droplet or a repository can be modified to also provide a list / array that you want so that you can easily pass it on to your new Droplet as a param. FYI - In case of repository you can write a custom property descriptor which can return an array