Search code examples
htmljstltagstranslate

JSTL tag not translate in HTML


My imports :

  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"

My JSTL Code :

  <h:outputLabel value="YESS" >
  <fmt:formatNumber value="0.25" type="percent"></fmt:formatNumber>

HTML generated code:

  <label>YESS</label>
  <fmt:formatNumber value="0.25" type="percent"></fmt:formatNumber>

The generated code show that the JSTL core is translate in HTML.
But the JSTL "fmt" is not translate in HTML.





More information:

    <fmt:ErrorInThisFunctionName value="0.25" type="percent" />    ===> generate an error
  • I work on Tomcat 6

Solution

  • What Pierre said, and also,

    Try xmlns:fmt="http://java.sun.com/jstl/fmt"

    Check web.xml for

    <web-app version="2.4"
                     xmlns="http://java.sun.com/xml/ns/j2ee"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">