You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Roberto Nunnari <ro...@supsi.ch> on 2007/06/16 20:54:46 UTC
S2 substitute for jstl empty operator
Hello again..
Another question..
in JSTL I can write:
<c:if test="${!empty myvar}">...</c:if>
The empty operator tests for null, empty strings and empty arrays..
if in S2 I type:
<s:if test="%{!empty myvar}">...</s:if>
it doesn't work.
Is there in S2 a substitute for the JSTL EL operator empty?
And for the ! operator?
Sorry for all the questions, but I couldn't find an answer in the S2 site.
Best regards.
--
Robi
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: S2 substitute for jstl empty operator
Posted by Zoran Avtarovski <zo...@sparecreative.com>.
The point being empty covers all the issues (null, empty string, empty list
or array). Too much sugar in our diet is my guess.
Z.
> --- Roberto Nunnari <ro...@supsi.ch> wrote:
>> ..and how's about empty strings?
>
> test='stringVar.length() > 0'
>
> d.
>
>
>
>
> ______________________________________________________________________________
> ______
> Building a website is a piece of cake. Yahoo! Small Business gives you all the
> tools to get online.
> http://smallbusiness.yahoo.com/webhosting
>
> ---------------------------------------------------------------------
> 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
Re: S2 substitute for jstl empty operator
Posted by Dave Newton <ne...@yahoo.com>.
--- Roberto Nunnari <ro...@supsi.ch> wrote:
> ..and how's about empty strings?
test='stringVar.length() > 0'
d.
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: S2 substitute for jstl empty operator
Posted by Roberto Nunnari <ro...@supsi.ch>.
Hello Guillame.
That is intended to check a List is empty, but it doesn quite substitute
the empty operator.. The empty operator tests for null, empty strings
and empty arrays..
I must then assume there's no single substitute?
..and how's about empty strings?
Best regards.
Guillaume Carré wrote:
> 2007/6/16, Roberto Nunnari <ro...@supsi.ch>:
>> humm... it seams that:
>> <s:if test="%{myvar}">
>> suffices for testing null..
>>
>> is that the correct usage? Best practices for the original problem?
>
> have you tried this?
> <s:if test="%{myvar.isEmpty}">
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: S2 substitute for jstl empty operator
Posted by Guillaume Carré <gu...@gmail.com>.
2007/6/16, Roberto Nunnari <ro...@supsi.ch>:
> humm... it seams that:
> <s:if test="%{myvar}">
> suffices for testing null..
>
> is that the correct usage? Best practices for the original problem?
have you tried this?
<s:if test="%{myvar.isEmpty}">
--
Guillaume Carré
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: S2 substitute for jstl empty operator
Posted by Roberto Nunnari <ro...@supsi.ch>.
Roberto Nunnari wrote:
> Hello again..
>
> Another question..
>
> in JSTL I can write:
>
> <c:if test="${!empty myvar}">...</c:if>
> The empty operator tests for null, empty strings and empty arrays..
>
> if in S2 I type:
> <s:if test="%{!empty myvar}">...</s:if>
> it doesn't work.
humm... it seams that:
<s:if test="%{myvar}">
suffices for testing null..
is that the correct usage? Best practices for the original problem?
>
> Is there in S2 a substitute for the JSTL EL operator empty?
> And for the ! operator?
>
> Sorry for all the questions, but I couldn't find an answer in the S2 site.
>
> Best regards.
>
> --
> Robi
>
> ---------------------------------------------------------------------
> 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