Hi,

I am a little surprised that having a class variable imported into a page isn't seen by JSTL contructs.
For example if i have a class that defines:


package com.company.test
public final class MyClass
{
  public static final String TEST =  "test";
}

and my JSP page has:

<[EMAIL PROTECTED] import="com.company.test.MyClass"%>
<c:out value="${MyClass.TEST}"/>

you don't get any output.

If you add:
<%
pageContext.setAttribute("test", MyClass.TEST);
%>

and change the JSTL to:
<c:out value="${test}"/>

then it works.

But surely the MyClass.TEST already had page scope otherwise the setAttribute wouldn't have seen it?

The upshot of all this is that I am iterating through a map that can have any one of about 30 keys.
Do I really have to put all these keys into the session or some other scope every time I load the page?


Thanks,
Andy

_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger http://www.msn.co.uk/messenger



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



Reply via email to