Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Struts - logic tag question

Reply
Thread Tools

Struts - logic tag question

 
 
Igor
Guest
Posts: n/a
 
      07-14-2003
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


 
Reply With Quote
 
 
 
 
Wendy S
Guest
Posts: n/a
 
      07-14-2003
"Igor" <(E-Mail Removed)> wrote in message
news:N5GQa.44063$(E-Mail Removed) le.rogers.com...
> 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/str...gic.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


 
Reply With Quote
 
 
 
 
Igor
Guest
Posts: n/a
 
      07-14-2003
Thanks Wendy,

it worked.

"Wendy S" <(E-Mail Removed)> wrote in message
news:bevbj9$gei$(E-Mail Removed)...
> "Igor" <(E-Mail Removed)> wrote in message
> news:N5GQa.44063$(E-Mail Removed) le.rogers.com...
> > 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/str...gic.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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Question about Struts <logic:iterate> tag javadude Java 2 06-30-2005 06:55 PM
Struts logic:equal tag problem Emilio Java 0 07-12-2004 03:42 PM
Struts tag <logic:iterate> Jack_A Java 1 05-19-2004 09:33 AM
Struts redirect logic tag issues Damien Eversmann Java 0 07-09-2003 06:36 PM



Advertisments