You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vaneet Sharma <va...@crisil.com> on 2006/09/07 14:09:08 UTC

How to set a form bean property of type HashMap in jsp

Can anybody tell me how to set a form bean property of type 
java.util.HashMap in a jsp page.
Actually i am prepolulating this property in action and then forwarding to 
a jsp page.
In this jsp page i need to again set this property ,so tht if there is 
some validation error then this HashMap is not lost.
So tht is why i want to set this property of type HashMap in jsp page . 


Regards
Vaneet. Sharma 
CRISIL. 
Office- (91)-22-6644 4116 
M- (91)-93223 39127
Disclaimer : 
This message and any attachments (hereinafter referred to as the Said Information) are  intended solely for the addressee. The Said Information is confidential and may be privileged and is also prohibited from disclosure. Access, use, copying, distribution or e-use of the Said Information by anyone except the addressee is unauthorized. If you are not the intended addressee, please destroy all copies of  the Said Information in your possession and also delete the same from your computer. Any views expressed in the Said Information are those of the individual sender except where the sender, with due authority of CRISIL Ltd./CRISIL MarketWire Ltd./Global Data Services of India Ltd. specifically states them to be the views of CRISIL Ltd./CRISIL MarketWire Ltd./Global Data Services of India Ltd. Nothing contained in the Said Information is capable or intended to create any legally binding obligations on the sender  CRISIL Ltd./CRISIL MarketWire Ltd./Global Data Services of India L
 td. who accept no responsibility, whatsoever, for loss or damage from the use of  the Said Information including damage from viruses.

Re: How to set a form bean property of type HashMap in jsp

Posted by Puneet Lakhina <pu...@gmail.com>.
On 9/7/06, Vaneet Sharma <va...@crisil.com> wrote:
>
> Can anybody tell me how to set a form bean property of type
> java.util.HashMap in a jsp page.
> Actually i am prepolulating this property in action and then forwarding to
> a jsp page.
> In this jsp page i need to again set this property ,so tht if there is
> some validation error then this HashMap is not lost.
> So tht is why i want to set this property of type HashMap in jsp page .


If all you need to do is to copy the property you  can use  <bean:define>

If your hashmap is being set as a request attribute

<bean:define name="mapAttributeName" id="copiedMap" scope="request"/>

If its a property of the form bean then,

<bean:define name="formBean" property="mapProperty" id="copiedMap"
scope="request"/>

Read this for more
http://struts.apache.org/1.2.x/api/org/apache/struts/taglib/bean/package-summary.html#package_description

-- 
Puneet