1 Reply Latest reply on May 18, 2009 3:22 PM by Nick Belaevski

    how to declare varibales in side page

    praveen jain Novice

      hi
      i want ot use NumberFormat on a filed i am using like this but getting error

      <%
      
      NumberFormat formatter = new DecimalFormat("#.##");
      
      %>
      

      declared the variables
      <rich:scrollableDataTable height="150px" width="500px" sortMode="false"
       value="#{mainBind.customWizard.clstrDtl.deviceList}" var="device">
      
      <rich:column id="freespace" sortable="false">
       <f:facet name="header">
       <h:outputLabel styleClass="headerText" value="Free Space" />
       </f:facet>
       <h:outputText value="#{formatter.format(device.freeSpace/1073741824)} GB" />
       </rich:column>
      
      

      but i am getting error

      Caused by: javax.servlet.ServletException: javax.servlet.jsp.JspException: org.apache.jasper.JasperException: /pages/wizards/ClusterWizard.jsp(197,6) The function format must be used with a prefix when a default namespace is not specified
      at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
      at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
      at org.apache.jsp.pages.Wizard_jsp._jspService(Wizard_jsp.java:113)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
      ... 54 more

      what i need to do
      or is thr any way to use ?