It seems to me from the way that it was described in the "Essential JSP Expression Language" RefCardz on dzone.com that I should be able to use the "empty" operator to safely check the existence of a Context Environment variable. Am I reading that right?
Basically, my thought is something like this:
Given that *if* the variable "thisvar" exists in WEB-INF/web.xml in a Tomcat webapp, it would be defined as follows:
Then, from the JSP page, I should be able to check if it *does* exist, and if so, use it with something like this:
Does this seem right, or am I way off-base here?
TIA for your help.
"I do not feel obliged to believe that the same God who has endowed us with sense, reason, and intellect has intended us to forgo their use."
-- Galileo Galilei
It looks like you are trying to embed EL expressions inside a Javastring inside Java code? That's not going to work. The JSTL and EL are meant to work directly inside JSP pages without any Java code.
In any case, I'm not sure that the EL automatically exposes env entries to begin with. If you need access from a JSP, you may need to write a bean that gathers the information and exposes it through properties so that the EL can access it.
If you need access from Java code, the EL is not in the picture.