ServletContext attributes 'foo'
 #application['foo'] or #application.foo

 Access to PageContext for attribute foo
 #attr['foo'] or #attr.foo

in WebWork 1.x one could access special named objects (the request scope
attributes to be exact) by using "@foo",
but now special variables are accessed using "#foo" is merely a request to
another object in the OgnlContext <other than the root>

http://struts.apache.org/2.0.11.1/docs/ognl-basics.html
Good Stuff
Martin
----- Original Message -----
From: "Adam Hardy" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Saturday, April 19, 2008 9:11 PM
Subject: Re: from Action to PageContext: how's it done?


> Dave Newton on 20/04/08 00:23, wrote:
> > --- Adam Hardy <[EMAIL PROTECTED]> wrote:
> >> So you say the StrutsRequestWrapper holds the struts context [...]
> >
> > No, I'm saying it has access to it via ActionContext.getContext().
> >
> >> and is accessed  somewhere in the Result to pull everything down
> >> into the PageContext?
> >
> > I'm not sure what that means.
> >
> > All the request wrapper does (slightly simplified) is call
super.getAttribute
> > (where super is an HttpServletRequestWrapper). If nothing is returned
from
> > that, as would be the case with a typical action and action property,
then
> > the wrapper will query the stack for the value.
> >
> > You should probably just look at the source code, no?
>
> Yes, I guess I should if I had a team of sherpas for the expedition. I
once
> scaled the face of the Hibernate Source Massif and only 3 of the team came
back
> alive.
>
> But seriously, I appreciate your comments a lot since they buy me out of
lot of
> hard source code reading, which is not something too pleasant when you
don't
> know where you're aiming for, as you probably know.
>
> What you're saying is clear except one thing - in JSTL I can access the
action.
> And in JSTL, I'm not calling request.getAttribute() - I'm _not_ doing
this:
>
> ${requestScope['myObject']}
>
> I'm just doing this:
>
> ${myObject}
>
> and struts somehow gives me the right info, which to my mind means that
Struts
> has put that object into the PageContext already.
>
> ---------------------------------------------------------------------
> 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