File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes format problem in bean:write Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "format problem in bean:write" Watch "format problem in bean:write" New topic

format problem in bean:write

shah rah
Ranch Hand

Joined: Jan 04, 2007
Posts: 124
<bean:write name="employee" property="salary" format="$#,000.000" />

my salary is of type String and thus it does not work. Is there a away I can convert it into Double inside the beean:write tag. or should I go about using scriptlets
Jim Hardin
Ranch Hand

Joined: Aug 02, 2006
Posts: 46
I don't know if this helps, but it seems to me it would be easier to make the "salary" Form Bean property/instance-variable a numeric type from the outset.
I agree. Here's the link:
subject: format problem in bean:write
It's not a secret anymore!