You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Christopher Johnson <ct...@gmail.com> on 2012/08/20 17:39:17 UTC
Re: accessing properties/attributes (scope)
Lukasz,
I changed <tiles:importAttribute /> to include 'scope="request"' and I now
see my variables in the request scope and can access them via
#request.url. Thank you.
---
>From what I've read there are the following scopes in struts.
- application
- session
- request
- page
- action
I can see application, session, request in <s:debug /> and see how to
access the different parts via #application, #session, #request. I see
action as well but haven't tested accessing its attributes.
What I don't see is "page".
By default <tiles:importAttribute /> imports to the "page" scope.
I guess I'm just missing something important. How do I access variables in
the page scope via ognl expressions?
Thank you,
-Chris
On Mon, Aug 20, 2012 at 9:11 AM, Lukasz Lenart <lu...@apache.org>wrote:
> 2012/8/20 Christopher Johnson <ct...@gmail.com>:
> > #url turns out to be null because it can't. <s:debug /> does not show it
> > anywhere.
>
> Did you try #request.url ? As this should be a request scoped variable.
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: accessing properties/attributes (scope)
Posted by Christopher Johnson <ct...@gmail.com>.
Thank you, that makes sense. I've read that page a few dozen times and it
did not click until you gave the example.
Best,
-Chris
On Mon, Aug 20, 2012 at 3:26 PM, Lukasz Lenart <lu...@apache.org>wrote:
> 2012/8/20 Christopher Johnson <ct...@gmail.com>:
> > From what I've read there are the following scopes in struts.
> >
> > - application
> > - session
> > - request
> > - page
> > - action
> >
> > I can see application, session, request in <s:debug /> and see how to
> > access the different parts via #application, #session, #request. I see
> > action as well but haven't tested accessing its attributes.
> >
> > What I don't see is "page".
> >
> > By default <tiles:importAttribute /> imports to the "page" scope.
> >
> > I guess I'm just missing something important. How do I access variables
> in
> > the page scope via ognl expressions?
>
> You can use #attr.url
>
> http://struts.apache.org/2.x/docs/ognl.html
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: accessing properties/attributes (scope)
Posted by Lukasz Lenart <lu...@apache.org>.
2012/8/20 Christopher Johnson <ct...@gmail.com>:
> From what I've read there are the following scopes in struts.
>
> - application
> - session
> - request
> - page
> - action
>
> I can see application, session, request in <s:debug /> and see how to
> access the different parts via #application, #session, #request. I see
> action as well but haven't tested accessing its attributes.
>
> What I don't see is "page".
>
> By default <tiles:importAttribute /> imports to the "page" scope.
>
> I guess I'm just missing something important. How do I access variables in
> the page scope via ognl expressions?
You can use #attr.url
http://struts.apache.org/2.x/docs/ognl.html
Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org