Grokbase Groups Struts user May 2004
FAQ
Hi folks... this should be a simple one, but I've been reading for about 30
minutes now without finding the answer...

I have a collection that I iterate over with logic:iterate, building a
table... normal stuff... problem is, the collection might be null, which the
tag handles just fine, except that since I start my table OUTSIDE the
logic:iterate tag, I have a black square on the screen, the outline of the
table.

So, my question simply is what tag can I use, and with what syntax, to check
if a collection in a bean is null before starting my logic:iterate tag? I
of course found logic:equal. but it doesn't seem like it would do what I
want. logic:notEmpty or maybe logic:notPresent might be the ticket, but I'm
not sure how to set up the tag if one of them is the answer.

Thanks all!

_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE
download! http://toolbar.msn.com/go/onm00200413ave/direct/01/


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

Search Discussions

  • Riyad Kalla at May 11, 2004 at 5:10 pm
    <logic:notEmpty name="myList">
    <table ...>
    ...
    <logic:iterate id="item" name="myList" type="java.lang.String">
    ...
    </logic:iterate>
    ...
    </table>
    </logic:notEmpty>

    On Tuesday 11 May 2004 10:03 am, None None wrote:
    Hi folks... this should be a simple one, but I've been reading for about 30
    minutes now without finding the answer...

    I have a collection that I iterate over with logic:iterate, building a
    table... normal stuff... problem is, the collection might be null, which
    the tag handles just fine, except that since I start my table OUTSIDE the
    logic:iterate tag, I have a black square on the screen, the outline of the
    table.

    So, my question simply is what tag can I use, and with what syntax, to
    check if a collection in a bean is null before starting my logic:iterate
    tag? I of course found logic:equal. but it doesn't seem like it would do
    what I want. logic:notEmpty or maybe logic:notPresent might be the ticket,
    but I'm not sure how to set up the tag if one of them is the answer.

    Thanks all!

    _________________________________________________________________
    MSN Toolbar provides one-click access to Hotmail from any Web page – FREE
    download! http://toolbar.msn.com/go/onm00200413ave/direct/01/


    ---------------------------------------------------------------------
    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
  • Paul-J Woodward at May 11, 2004 at 5:10 pm
    logic:notEmpty is the correct answer

    Paul
    ------------------------------------------------------------
    Global Equity Derivatives Technology
    Deutsche Bank [/]
    ------------------------------------------------------------




    "None None" <fzammett@hotmail.com>
    11/05/2004 18:03
    Please respond to "Struts Users Mailing List"


    To: user@struts.apache.org
    cc:
    Subject: Null collections


    Hi folks... this should be a simple one, but I've been reading for about
    30
    minutes now without finding the answer...

    I have a collection that I iterate over with logic:iterate, building a
    table... normal stuff... problem is, the collection might be null, which
    the
    tag handles just fine, except that since I start my table OUTSIDE the
    logic:iterate tag, I have a black square on the screen, the outline of the

    table.

    So, my question simply is what tag can I use, and with what syntax, to
    check
    if a collection in a bean is null before starting my logic:iterate tag? I

    of course found logic:equal. but it doesn't seem like it would do what I
    want. logic:notEmpty or maybe logic:notPresent might be the ticket, but
    I'm
    not sure how to set up the tag if one of them is the answer.

    Thanks all!

    _________________________________________________________________
    MSN Toolbar provides one-click access to Hotmail from any Web page ? FREE
    download! http://toolbar.msn.com/go/onm00200413ave/direct/01/


    ---------------------------------------------------------------------
    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
  • None None at May 11, 2004 at 5:14 pm
    Wow, it really is that easy, isn't it?!? :) The only problem is that, as I
    understand it, this will check if the myList BEAN is present, I actually
    need to see if a given property of a bean is null. I answered that part
    myself though... there's a property attribute, just like logic:iterate, and
    now it does what I wanted. Thanks very much!

    From: Riyad Kalla <rsk@email.arizona.edu>
    Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
    To: "Struts Users Mailing List" <user@struts.apache.org>
    Subject: Re: Null collections
    Date: Tue, 11 May 2004 10:06:49 -0700

    <logic:notEmpty name="myList">
    <table ...>
    ...
    <logic:iterate id="item" name="myList" type="java.lang.String">
    ...
    </logic:iterate>
    ...
    </table>
    </logic:notEmpty>

    On Tuesday 11 May 2004 10:03 am, None None wrote:
    Hi folks... this should be a simple one, but I've been reading for about 30
    minutes now without finding the answer...

    I have a collection that I iterate over with logic:iterate, building a
    table... normal stuff... problem is, the collection might be null, which
    the tag handles just fine, except that since I start my table OUTSIDE the
    logic:iterate tag, I have a black square on the screen, the outline of the
    table.

    So, my question simply is what tag can I use, and with what syntax, to
    check if a collection in a bean is null before starting my logic:iterate
    tag? I of course found logic:equal. but it doesn't seem like it would do
    what I want. logic:notEmpty or maybe logic:notPresent might be the ticket,
    but I'm not sure how to set up the tag if one of them is the answer.

    Thanks all!

    _________________________________________________________________
    MSN Toolbar provides one-click access to Hotmail from any Web page – FREE
    download! http://toolbar.msn.com/go/onm00200413ave/direct/01/


    ---------------------------------------------------------------------
    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
    _________________________________________________________________
    FREE pop-up blocking with the new MSN Toolbar – get it now!
    http://toolbar.msn.com/go/onm00200415ave/direct/01/


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
    For additional commands, e-mail: user-help@struts.apache.org
  • Riyad Kalla at May 11, 2004 at 5:18 pm
    Woops I just reread your message and noticed that I missed that part. But you
    found it, so nice job.

    Have fun strusting
    On Tuesday 11 May 2004 10:13 am, None None wrote:
    Wow, it really is that easy, isn't it?!? :) The only problem is that, as I
    understand it, this will check if the myList BEAN is present, I actually
    need to see if a given property of a bean is null. I answered that part
    myself though... there's a property attribute, just like logic:iterate, and
    now it does what I wanted. Thanks very much!
    From: Riyad Kalla <rsk@email.arizona.edu>
    Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
    To: "Struts Users Mailing List" <user@struts.apache.org>
    Subject: Re: Null collections
    Date: Tue, 11 May 2004 10:06:49 -0700

    <logic:notEmpty name="myList">
    <table ...>
    ...
    <logic:iterate id="item" name="myList" type="java.lang.String">
    ...
    </logic:iterate>
    ...
    </table>
    </logic:notEmpty>
    On Tuesday 11 May 2004 10:03 am, None None wrote:
    Hi folks... this should be a simple one, but I've been reading for
    about 30
    minutes now without finding the answer...

    I have a collection that I iterate over with logic:iterate, building a
    table... normal stuff... problem is, the collection might be null,
    which the tag handles just fine, except that since I start my table
    OUTSIDE the
    logic:iterate tag, I have a black square on the screen, the outline of the
    table.

    So, my question simply is what tag can I use, and with what syntax, to
    check if a collection in a bean is null before starting my
    logic:iterate tag? I of course found logic:equal. but it doesn't seem
    like it would do
    what I want. logic:notEmpty or maybe logic:notPresent might be the ticket,
    but I'm not sure how to set up the tag if one of them is the answer.

    Thanks all!

    _________________________________________________________________
    MSN Toolbar provides one-click access to Hotmail from any Web page – FREE
    download! http://toolbar.msn.com/go/onm00200413ave/direct/01/


    ---------------------------------------------------------------------
    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
    _________________________________________________________________
    FREE pop-up blocking with the new MSN Toolbar – get it now!
    http://toolbar.msn.com/go/onm00200415ave/direct/01/


    ---------------------------------------------------------------------
    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
  • Slattery, Tim - BLS at May 11, 2004 at 5:17 pm

    So, my question simply is what tag can I use, and
    with what syntax, to check if a collection in a bean
    is null before starting my logic:iterate tag? I of course
    found logic:equal. but it doesn't seem like it would do
    what I want. logic:notEmpty or maybe logic:notPresent
    might be the ticket, but I'm not sure how to set up the tag if
    one of them is the answer.
    The JSTL <c:if...> tag will do it:

    <c:if test="${!empty bean.collection}}">
    generate table
    </c:if?


    --
    Tim Slattery
    Slattery_T@bls.gov


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
    For additional commands, e-mail: user-help@struts.apache.org
  • None None at May 11, 2004 at 5:41 pm
    You know, it's kinda funny you mention it but the past few days I actually
    HAVE been having fun learning Struts! After havng my head in the clouds
    architecting large systems and having to do so based on homegrown framework
    solutions that are less than optimal (and that's being very polite!), Struts
    is a joy to play with and get my hands firty with.
    From: Riyad Kalla <rsk@email.arizona.edu>
    Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
    To: "Struts Users Mailing List" <user@struts.apache.org>
    Subject: Re: Null collections
    Date: Tue, 11 May 2004 10:14:44 -0700

    Woops I just reread your message and noticed that I missed that part. But
    you
    found it, so nice job.

    Have fun strusting
    On Tuesday 11 May 2004 10:13 am, None None wrote:
    Wow, it really is that easy, isn't it?!? :) The only problem is that, as I
    understand it, this will check if the myList BEAN is present, I actually
    need to see if a given property of a bean is null. I answered that part
    myself though... there's a property attribute, just like logic:iterate, and
    now it does what I wanted. Thanks very much!
    From: Riyad Kalla <rsk@email.arizona.edu>
    Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
    To: "Struts Users Mailing List" <user@struts.apache.org>
    Subject: Re: Null collections
    Date: Tue, 11 May 2004 10:06:49 -0700

    <logic:notEmpty name="myList">
    <table ...>
    ...
    <logic:iterate id="item" name="myList" type="java.lang.String">
    ...
    </logic:iterate>
    ...
    </table>
    </logic:notEmpty>
    On Tuesday 11 May 2004 10:03 am, None None wrote:
    Hi folks... this should be a simple one, but I've been reading for
    about 30
    minutes now without finding the answer...

    I have a collection that I iterate over with logic:iterate, building
    a
    table... normal stuff... problem is, the collection might be null,
    which the tag handles just fine, except that since I start my table
    OUTSIDE the
    logic:iterate tag, I have a black square on the screen, the outline
    of
    the
    table.

    So, my question simply is what tag can I use, and with what syntax,
    to
    check if a collection in a bean is null before starting my
    logic:iterate tag? I of course found logic:equal. but it doesn't
    seem
    like it would do
    what I want. logic:notEmpty or maybe logic:notPresent might be the ticket,
    but I'm not sure how to set up the tag if one of them is the answer.

    Thanks all!

    _________________________________________________________________
    MSN Toolbar provides one-click access to Hotmail from any Web page – FREE
    download! http://toolbar.msn.com/go/onm00200413ave/direct/01/

    ---------------------------------------------------------------------
    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
    _________________________________________________________________
    FREE pop-up blocking with the new MSN Toolbar – get it now!
    http://toolbar.msn.com/go/onm00200415ave/direct/01/


    ---------------------------------------------------------------------
    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
    _________________________________________________________________
    Best Restaurant Giveaway Ever! Vote for your favorites for a chance to win
    $1 million! http://local.msn.com/special/giveaway.asp


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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriesstruts
postedMay 11, '04 at 5:05p
activeMay 11, '04 at 5:41p
posts7
users4
websitestruts.apache.org
irc#struts

People

Translate

site design / logo © 2022 Grokbase