0 Replies Latest reply on Nov 23, 2009 12:39 PM by k l

    How to access static a value with RichFaces ?

    k l Newbie

      Hi !

      I have a java class Constants which contains a list of hundreds of static values and I try to access them from a JSP.

      Normally, in JSP I type the following code and it works :

      <%=com.xxx.resources.Constants.MY_CONSTANT%>


      But if do this, I get this error :
      javax.servlet.ServletException: Error Parsing /index.jsp: Error Traced[line: 1] The markup in the document preceding the root element must be well-formed.
       javax.faces.webapp.FacesServlet.service(FacesServlet.java:270)
       org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
       org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
       org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
       org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
      


      If I use <%@ page import="com.xxx.resources.Constants"%> I get the same message.

      I don't want to add getters/setters in this constants class. Does anyone know how to resolve this issue?

      Thanks

      Kevin

      For information :
      RichFaces 3.3.2SR1
      Tomcat 6.0.18
      DTD XHTML 1.0 Transitional
      WebApp 2.5