Thank you for your response. I have set the value in the formbean.

hence, tried this instead
<td>
    <fmt:formatNumber value="${Form1.amount}" type="currency"/>
</td>

But only half of JSP is getting displayed. Not sure why? any idea why this happening?


When tried to debug I see an EL exception being thrown

"Unable to find a value for \"amount\" in object of class \"org.apache.struts.validator.DynaValidatorForm\" using operator \".\""

The form-bean does have the form-property amount. Not sure why it can't find it.

Thanks.



From: Ed Griebel <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
To: Struts Users Mailing List <user@struts.apache.org>
Subject: Re: struts and JSTL
Date: Mon, 23 Jan 2006 13:17:07 -0500

The problem is that you're putting the 'amount' field into a hidden
field and then trying to use that hidden field as a value, but your
amt bean will actually contain the value of the form field: "<input
type='hidden' value='123.00'/>"

Try this instead. First, in your action save this amount value to the
request scope:
   request.setAttribute("amount", yourAmountVar);

Then put in your JSP, assuming a JSP 2.0 container:
<td>
    <fmt:formatNumber value="${amount}" type="currency"/>
</td>

-ed

On 1/23/06, fea jabi <[EMAIL PROTECTED]> wrote:
> would like to display the value of property amount as $10,00,000. tried
> using the below.
>
> But getting an error/ it doesn't get displayed.
>
> Is this the way to do this. Or is there an easier way to do the same?
>
>
> <td>
>       <bean:define id="amt"><html:text name="Form1" property="amount"
> styleClass="invisibleInput" readonly="true" tabindex="-1"/></bean:define>
>       <% System.out.println(amt);%>
>       <fmt:formatNumber value="${amt}" type="currency"/>
> </td>
>
>
> Thanks.
>
> _________________________________________________________________
> Is your PC infected? Get a FREE online computer virus scan from McAfee(r)
> Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
    "The greatest tyrannies are always perpetrated in the name of the
noblest causes." Thomas Paine
    "Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety" - Benjamin
Franklin

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to