Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help Needed in EL

 
Viji Elango
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<fmt:message key="label.accountdetailsjsp.term_months">
<fmt aram value="${requestbean.term}"/>
</fmt:message>

Here the term is printed as 00060 Months. I wanted that to be 60 months.

How can i do that? Can i do that in the EL itself.

Any help is appreciated.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might be able to trick it like this:

<fmt:message key="label.accountdetailsjsp.term_months">
<fmt aram value="${requestbean.term + 0}"/>
</fmt:message>

I believe this would convert term from a String to an int before setting the param value.
 
Viji Elango
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marc. But i doubt whether this code will be approved during code review..
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can't you format it in the bean?
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right. The creator of the bean should have made the field an Integer and not a String.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic