I haven't actually tried this, but in theory it *should* work ...

  <c:out value='${"org.apache.struts.action.ACTION_MESSAGE"}'/>

The theory is that the double quotes inside delimit the entire name of the
scoped variable to be looked up.

Craig

On Wed, 4 Jun 2003, Steve Raeburn wrote:

> Date: Wed, 4 Jun 2003 19:13:55 -0700
> From: Steve Raeburn <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>,
>      [EMAIL PROTECTED]
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: RE: struts (and JSTL) expression language questions
>
> I've just started looking at using JSTL in my struts app. On the whole it
> looks interesting but I've run up against a problem that I've been asking
> about on the taglibs list today.
>
> How do you access scoped attributes that have dotted names? E.g.
> org.apache.struts.action.ACTION_MESSAGE.
>
> If you try to access this object using the EL, it attempts to interpret the
> name as if it were a nested set of beans. <c:out
> value="${org.apache.struts.action.ACTION_MESSAGE}/> would try to do this:
>
>   org.getApache().getStruts().getAction().getACTION_MESSAGE();
>
> ... which is obviously nonsense.
>
> If you know the scope that the bean is in, you can use an alternate syntax:
>
>   <c:out
> value="${requestScope[\"org.apache.struts.action.ACTION_MESSAGE\"]"} />
>
> But, there does not seem to be any way to access a bean if you do not know
> (or want to specify) the scope. Has anyone come up against this before? Is
> there a  straightforward solution or do we have to abandon dotted notation
> for scoped attributes?
>
> Steve
>
>
> > -----Original Message-----
> > From: David Graham [mailto:[EMAIL PROTECTED]
> > Sent: June 4, 2003 6:39 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: struts (and JSTL) expression language questions
> >
> >
> > >It is a hard (nearly impossible) task to convince some management teams
> > >that in order to use this new (and I think better) technology, we will
> > >have to
> > >adopt an entirely new paradigm where taglibs perform operations and EL
> > >accesses data.
> > >
> >
> > I wouldn't say it's a new paradigm.  It's faster, easier, and
> > cheaper to use
> > the JSTL than scriptlets and that will definitely motivate mgmt.
> > to support
> > the change :-).
> >
> > David
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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

Reply via email to