What we had done to handle this case is create a bean, but then have all of
our constants available in a static map available via getter.

static
{
        CONSTANT_MAP = new HashMap();
        CONSTANT_MAP.put("beanPropSystem", BEAN_PROP_SYSTEM);
}

public Map getConstants()
{
        return CONSTANT_MAP;
}

<c:out value='${system.constants["beanPropSystem"]}'/>



-----Original Message-----
From: Axel Gro� [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 25, 2004 5:02 AM
To: Struts Users Mailing List
Subject: EL - can't get access to my constants

dear friends!

i declared a getter method for a constant, but i can't use it using jsp2.0
Expression Language.

public class Constants{
..
public static String getBEAN_PROP_SYSTEM() {
                return BEAN_PROP_SYSTEM;
        }
..
}

in the jsp:
works fine:
 <%= ((Constants)session.getAttribute("constants")).getBEAN_PROP_SYSTEM() %>

[DEBUG] InsertTag - -[ServletException in:/WEB-INF/contents/System.jsp]
Unable to find a value for "BEAN_PROP_SYSTEM" in object of class
"at.ftw.struts.Constants" using operator "."'
<javax.servlet.jsp.el.ELException: Unable to find a value for
"BEAN_PROP_SYSTEM" in object of class "at.ftw.struts.Constants" using
operator ".">javax.servlet.jsp.el.ELException: Unable to find a value for
"BEAN_PROP_SYSTEM" in object of class "at.ftw.struts.Constants" using
operator "."


i attached the full stacktrace

thanks in advance,
Axel

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to