• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

format attribute in bean:write

 
pavanasree vasireddy
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using <fmt:formatNumber> You can specify pattern attribute

pattern="###,###" says that you need "," after first 3 digits
 
pavanasree vasireddy
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic