Results 1 to 3 of 3
  1. #1
    mallorz is offline Member
    Join Date
    Jan 2014
    Posts
    97
    Rep Power
    0

    Default JSP EL fmt:formatNumber not allowed as child of <span> or <section>

    I am trying to format a number to be currency in one of my JSP pages, however I am receiving an error message that reads

    "Element fmt:formatNumber not allowed as child of <span> in this context. (supressing further errors from subtree"

    I tried to find a way to do this with the c: core tags but am not very knowledgeable in this area and haven't found anything. I am sure there is more than one way to do this. Can anyone offer help?

    Java Code:
    <label>Formatted as Currency:</label>
        <span><fmt:formatNumber value="${number}" type="currency" /></span>

  2. #2
    mallorz is offline Member
    Join Date
    Jan 2014
    Posts
    97
    Rep Power
    0

    Default Re: JSP EL fmt:formatNumber not allowed as child of <span> or <section>

    Anyone? There has to be more than one way to do this.

  3. #3
    mallorz is offline Member
    Join Date
    Jan 2014
    Posts
    97
    Rep Power
    0

    Default Re: JSP EL fmt:formatNumber not allowed as child of <span> or <section>

    I found a workaround. I changed it back to just the parameter in EL - ${number} - and formatted it in the servlet with NumberFormat.

    Edit: Which actually doesn't work because it alters the format for the stored cookie as well. Back to square one - if you have ideas, please share them!
    Last edited by mallorz; 02-08-2015 at 05:52 PM.

Similar Threads

  1. group layout - span ?
    By random7 in forum AWT / Swing
    Replies: 4
    Last Post: 07-26-2010, 09:26 AM
  2. How to print a HTML/JSP span using javascript?
    By sayan751 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-14-2009, 06:38 AM
  3. How to span column headers over several columns
    By thayalan in forum AWT / Swing
    Replies: 0
    Last Post: 06-02-2009, 04:33 PM
  4. Replies: 1
    Last Post: 07-24-2007, 01:44 AM
  5. Replies: 1
    Last Post: 07-24-2007, 12:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •