struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hookom, Jacob" <Jacob.Hoo...@redline.mckhboc.com>
Subject RE: EL - can't get access to my constants
Date Wed, 25 Feb 2004 15:18:03 GMT
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:kamikaze@iaeste.at] 
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: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message