struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabriel Belingueres" <belingue...@gmail.com>
Subject Re: Problem with s:set and s:if
Date Sat, 12 Jul 2008 17:23:35 GMT
Looking at the docs:
http://struts.apache.org/2.1.2/docs/ognl.html

there is no #page notation when using struts taglibs, since they all
use OGNL syntax.
If you need to access a page scoped object, you need to use the #attr notation.

2008/7/12 Othon Reyes Sanchez <othon.reyes@gmail.com>:
> #page is not an instance of a user class.
> page is an implicit object of jsp like request, session, application, etc.
>
> i don't know what is happening if i use <s:set name="aver" scope="page"
> value="one"></s:set>
> to put the variable "aver" in the page object it works fine. i mean, i can
> use EL to use this var i.e. ( ${pageScope.aver} ).
>
> I think that my problem is that i don't know is how Io refer to the variable
> aver that "lives" in the page implicit object.
> I suppose there should be a way to do this, and i'm supposing this because
> JSTL lets you do it like the following code:
>
> <c:if test="${pageScope.aver=='one'} ">
> </c:if>
>
> i know S2 and JSTL is not the same but i think that this funcionality is
> basic and S2 should allow you, unless there is a reason to not put a
> instance in the page implicit object, but that doesn't have any sense. why
> does S2 works with request or session but not with page?.
>
> Did i made myself clear?.
>
> BTW thanks for your help Dave.
>
>
>
> On Fri, Jul 11, 2008 at 10:07 PM, Dave Newton <newton.dave@yahoo.com> wrote:
>
>> Is #page one of the stack context vars? I'd consider using #attr, unless
>> you can confirm that it is (I always forget). Or just use #request.
>>
>> Dave
>>
>> --- On Fri, 7/11/08, Othon Reyes Sanchez <othon.reyes@gmail.com> wrote:
>> > I have a problem with the following code:
>> >
>> > <s:set name="aver" scope="page"
>> > value="one"></s:set
>> > ...
>> > <s:if test="#page.aver=='one'">
>> > <%-- Some code goes here --%>
>> > </s:if>
>> >
>> > I don't know what is happening but the code
>> > conditionated by the if is not
>> > executed.
>> > If i use request instead of page in the s:set tag, and
>> > obiosly in the s:if
>> > tag, the code works fine.
>> >
>> > can somebody tell me what i'm doing wrong?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message