• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

error with the body of fmt:formatNumber

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

Hi,


I checked api for fmt:formatNumber and found that we can use JSP in body..

but when I am trying to put anything in thr body of <fmt:formatNumber></fmt:formatNumber >

its throwing error with message that invalid body..

Can anyone help me with this.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, JSP is allowed in the body of formatNumber. Can you send the exact error message, and the way you are using the tag ?
 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

This is the line of the code without bodya dn its working fine..
<td nowrap class="tCellnum"><fmt:formatNumbervalue="${element.extra.dealLevelAmount}" pattern="###,###.##"></fmt:formatNumber></td>


but when I am putting boy in this tag..like

<td nowrap class="tCellnum"><fmt:formatNumbervalue="${element.extra.dealLevelAmount}" pattern="###,###.##">N/A</fmt:formatNumber></td>


I am gettign this error ---

Encountered illegal body of tag "fmt:formatNumber" tag, given its attributes.</p>

..Please help me with this.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
N/A ?? Did you try with a number ? N/A is not a number.
 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes , I tried with number also but I am getting same error.. One more thing I got on this is if I am removing value attribute from tag and putting anything in body its working fine..

I put like


<td nowrap class="tCellnum"><fmt:formatNumber pattern="###,###.##">100</fmt:formatNumber></td>

and it worked .. But If I am putting

<td nowrap class="tCellnum"><fmt:formatNumbervalue="${element.extra.dealLevelAmount}" pattern="###,###.##">100</fmt:formatNumber></td>

I am getting invalid body error( same error)...
 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the error "Encountered illegal body of tag "fmt:formatNumber" tag, given its attributes.</p>
"

it seems if we are putting "value" attribute then we can't put anything in body...as the error says illegal body of tag given its attribute .. but Ia have guessed this now sure..
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Right, you cannot use both value and body content. You've got to choose one.
 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for confirmation
 
Shashi Prakash
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for confirmation
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic