You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mead Lai <la...@gmail.com> on 2008/10/20 09:25:30 UTC

how to find out the NULL value?

Hi All,

<s:if test="${username !=null}">Show something here</s:if>
<s:if test="username == null"> Show something here</s:if>
which is right Tag above?
I heared, It can't use like that expression after 2.0.11version, really?
Any feedback is appreciated.

-- 
BestRegards,
Mead
http://yayisoft.com

Bob Hope  - "A James Cagney love scene is one where he lets the other guy
live."

Re: how to find out the NULL value?

Posted by Dale Newfield <da...@newfield.org>.
Mead Lai wrote:
> Hi All,
> 
> <s:if test="${username !=null}">Show something here</s:if>
> <s:if test="username == null"> Show something here</s:if>

Neither.
${} is el
%{} is ognl
%{} in ognl is sometimes optional, but always confusing when left out.

In fact, if it were not optional, then we could much more easily let 
developers using struts select the expression language they'd like to 
invoke when writing the tag: ${}, %{}, #{}, etc. (rather than 
declaratively for the whole web-app)

-Dale

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


Re: how to find out the NULL value?

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
Mead Lai on 20/10/08 08:25, wrote:
> Hi All,
> 
> <s:if test="${username !=null}">Show something here</s:if>

You can do this with JSTL tags:

<c:if test="${not empty username}">


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


Re: how to find out the NULL value?

Posted by Mead Lai <la...@gmail.com>.
I use <s:if test="sendId eq '' " /> can't find the blank String(""), like ''

On Mon, Oct 20, 2008 at 3:31 PM, Mead Lai <la...@gmail.com> wrote:

> like this format?
> <s:if test="username neq null">Show something here</s:if>
> Thank you very much.
>
>
> On Mon, Oct 20, 2008 at 3:26 PM, Al Sutton <al...@alsutton.com> wrote:
>
>> I use
>>
>> username neq null
>>
>> or
>>
>> usename eq null
>>
>> Al.
>>
>> Mead Lai wrote:
>>
>>> Hi All,
>>>
>>> <s:if test="${username !=null}">Show something here</s:if>
>>> <s:if test="username == null"> Show something here</s:if>
>>> which is right Tag above?
>>> I heared, It can't use like that expression after 2.0.11version, really?
>>> Any feedback is appreciated.
>>>
>>>
>>>
>>
>>
>> --
>> Al Sutton
>>
>> W: www.alsutton.com
>> B: alsutton.wordpress.com
>> T: twitter.com/alsutton
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
> --
> BestRegards,
> Mead
> http://yayisoft.com
>
> Rita Rudner  - "I wonder if other dogs think poodles are members of a weird
> religious cult."
>



-- 
BestRegards,
Mead
http://yayisoft.com

Joan Rivers  - "The first time I see a jogger smiling, I'll consider it."

Re: how to find out the NULL value?

Posted by Mead Lai <la...@gmail.com>.
like this format?
<s:if test="username neq null">Show something here</s:if>
Thank you very much.

On Mon, Oct 20, 2008 at 3:26 PM, Al Sutton <al...@alsutton.com> wrote:

> I use
>
> username neq null
>
> or
>
> usename eq null
>
> Al.
>
> Mead Lai wrote:
>
>> Hi All,
>>
>> <s:if test="${username !=null}">Show something here</s:if>
>> <s:if test="username == null"> Show something here</s:if>
>> which is right Tag above?
>> I heared, It can't use like that expression after 2.0.11version, really?
>> Any feedback is appreciated.
>>
>>
>>
>
>
> --
> Al Sutton
>
> W: www.alsutton.com
> B: alsutton.wordpress.com
> T: twitter.com/alsutton
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
BestRegards,
Mead
http://yayisoft.com

Rita Rudner  - "I wonder if other dogs think poodles are members of a weird
religious cult."

Re: how to find out the NULL value?

Posted by Al Sutton <al...@alsutton.com>.
I use

username neq null

or

usename eq null

Al.

Mead Lai wrote:
> Hi All,
>
> <s:if test="${username !=null}">Show something here</s:if>
> <s:if test="username == null"> Show something here</s:if>
> which is right Tag above?
> I heared, It can't use like that expression after 2.0.11version, really?
> Any feedback is appreciated.
>
>   


-- 
Al Sutton

W: www.alsutton.com
B: alsutton.wordpress.com
T: twitter.com/alsutton


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