You haven't shown the EL syntax that you're trying to use.  If you're just trying to 
reference normal properties, note that property accessors cannot be static methods, 
they have to be normal instance methods.

If you're trying to reference constants, you might be better off putting the constant 
values into a map, keyed by the symbol name.  You could either do this manually with a 
small number of constants, or automatically using reflection.

I also believe that the JSP 2.0 "function" syntax (which I'm not that familiar with 
yet) might allow you to use a static method.

You might be better off asking about this on the taglibs-user list.

-----Original Message-----
From: Axel Groß [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 25, 2004 3: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