Daniel,

I often can across this problem in my development and found that a possible solution is to use the
runtime-based version of the JSTL.

<%@ taglib prefix="c_rt" uri="http://java.sun.com/jstl/core_rt"; %>


<c_rt:out value="<%= GlobalConstants.ACCOUNT_PROFILE_SESSION_ATTRIBUTE %>"/>

It does involve scriplet but which is it's main down fall.  Hope it helps

*************************************
Ruben Cepeda
[EMAIL PROTECTED]
*************************************



----Original Message Follows----
From: "Kalcevich, Daniel" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
To: "Struts Users Mailing List" <user@struts.apache.org>
Subject: [OT] JSTL question
Date: Thu, 16 Mar 2006 14:25:53 -0800

I am trying to access a session object where the key is the field
"ACCOUNT_PROFILE_SESSION_ATTRIBUTE" in a Constants JAVA file called
"GlobalConstants".  I created a wrapper around it that extends Map
(JSTLConstants) to contain all the constants so I could access it via
JSTL.  I am trying to do the following:



<jsp:useBean id="GlobalConstants" class="com.JSTLConstants"/>

<c:set var="accountProfile"
value="${GlobalConstants.ACCOUNT_PROFILE_SESSION_ATTRIBUTE}"
scope="page"/>



<c:out value="${sessionScope[accountProfile].accountName}"/>



My question is, how can I use the
GlobalConstants.ACCOUNT_PROFILE_SESSION_ATTRIBUTE value to lookup my
object in the Session using JSTL?



Dan



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

Reply via email to