You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Eric W Hauser <eh...@indiana.edu> on 2003/07/02 05:47:04 UTC

Accessing static variables

I searched through the archives, and I couldn't find a good answer for
this question.  Is there a reason why there is not a JSTL tag to expose
the static final variables for a class? You can obviously do this by
importing the class and using <%= MyClass.STATICVAR %>, or by specifying
it as an attribute in the session or request scope.

I don't believe it would be too difficult to code the necessary tag, but I
was first curious as to why this was keep out of the specification.  My
guess would be that someone was trying to say that it is best to keep
string literals out of source code, and that they could be better defined
in a properties file.  However, a web application framework I use makes
use of String literals in the source files, so I was looking for a way to
access them without scriptlets.

 -------------------
Eric Hauser
ehauser@indiana.edu
(317) 679-4766


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org