aspose file tools*
The moose likes Struts and the fly likes format attribute in bean:write Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "format attribute in bean:write" Watch "format attribute in bean:write" New topic
Author

format attribute in bean:write

pavanasree vasireddy
Ranch Hand

Joined: Jun 12, 2004
Posts: 34
Hi,

I am experiencing an issue using format attribute in the <bean:write> tag

I have property which is of type integer. In the jsp page i want to display

the value like 01.. 02 .. 03 if the the value is less than 10..


How do i use format attribute of bean: write to display the value in the proper formate...

Any help.. appreciated..


Thanks in advance

Pavana Sree
Vani Bandargal
Ranch Hand

Joined: Oct 06, 2005
Posts: 82
Try using <fmt:formatNumber> You can specify pattern attribute

pattern="###,###" says that you need "," after first 3 digits
pavanasree vasireddy
Ranch Hand

Joined: Jun 12, 2004
Posts: 34
Hi,

Thanks for the reply,


Can't i use format attribute of the struts tag <bean:write>

I have to display the value which is 5 as 05
Vani Bandargal
Ranch Hand

Joined: Oct 06, 2005
Posts: 82
Yes, you can
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: format attribute in bean:write