Struts - logic tag question

Discussion in 'Java' started by Igor, Jul 14, 2003.

  1. Igor

    Igor Guest

    Hi all,

    Struts 1.1

    How can I check property of my action form bean inside one of logic tags
    (logic:empty)?
    What should I set for "name" property of logic:empty tag?
    I want the tag to check property of the bean mapped to the form.

    When I use one of html tags and don't specify name property they refer to
    the action form bean.
    if I don't specify name property of "logic:empty" tag I get an exception.

    Thanks in advance,
    Igor
     
    Igor, Jul 14, 2003
    #1
    1. Advertising

  2. Igor

    Wendy S Guest

    "Igor" <> wrote in message
    news:N5GQa.44063$...
    > How can I check property of my action form bean inside one of logic tags
    > (logic:empty)?
    > What should I set for "name" property of logic:empty tag?
    > I want the tag to check property of the bean mapped to the form.


    http://jakarta.apache.org/struts/struts-logic.html#empty
    Set the name to whatever the name of your form bean is, then use 'property'
    to indicate which 'get' method should be called. (The name of your form
    bean is in struts-config.xml as <action path="..." name="formbeanName"
    ..../> )

    The 'logic' tags don't default to the form bean, you can use them with any
    bean.

    You might also want to consider switching to JSTL for the if/else/present
    type of logic. Post your <logic:empty> tag and someone can help with the
    equivalent JSTL tags.

    --
    Wendy in Chandler, AZ
     
    Wendy S, Jul 14, 2003
    #2
    1. Advertising

  3. Igor

    Igor Guest

    Thanks Wendy,

    it worked.

    "Wendy S" <> wrote in message
    news:bevbj9$gei$...
    > "Igor" <> wrote in message
    > news:N5GQa.44063$...
    > > How can I check property of my action form bean inside one of logic tags
    > > (logic:empty)?
    > > What should I set for "name" property of logic:empty tag?
    > > I want the tag to check property of the bean mapped to the form.

    >
    > http://jakarta.apache.org/struts/struts-logic.html#empty
    > Set the name to whatever the name of your form bean is, then use

    'property'
    > to indicate which 'get' method should be called. (The name of your form
    > bean is in struts-config.xml as <action path="..." name="formbeanName"
    > .../> )
    >
    > The 'logic' tags don't default to the form bean, you can use them with any
    > bean.
    >
    > You might also want to consider switching to JSTL for the if/else/present
    > type of logic. Post your <logic:empty> tag and someone can help with the
    > equivalent JSTL tags.
    >
    > --
    > Wendy in Chandler, AZ
    >
    >
     
    Igor, Jul 15, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Damien Eversmann

    Struts redirect logic tag issues

    Damien Eversmann, Jul 9, 2003, in forum: Java
    Replies:
    0
    Views:
    2,763
    Damien Eversmann
    Jul 9, 2003
  2. Jack_A

    Struts tag <logic:iterate>

    Jack_A, May 18, 2004, in forum: Java
    Replies:
    1
    Views:
    8,825
    Martin
    May 19, 2004
  3. Emilio
    Replies:
    0
    Views:
    812
    Emilio
    Jul 12, 2004
  4. javadude
    Replies:
    2
    Views:
    5,929
    Wendy Smoak
    Jun 30, 2005
  5. shruds
    Replies:
    1
    Views:
    871
    John C. Bollinger
    Jan 27, 2006
Loading...

Share This Page