You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rick Reumann <ma...@reumann.net> on 2002/04/28 01:53:27 UTC
multiple values to check in logic tag?
Is there a way to check multiple values on one line using such logic
tags like "notEqual" or "present" ? I'm trying to convert a JSP over
using struts tags and it's not going so well because I end up having
all these logic tags all nested within each other. For example say I
don't want to display a row of state information if the database query
comes back missing a city, state, or zip code. In my page I have:
if ( city != null && state != null && zip != null)
{
out.println( city + ", " +state + " " +zip+"<BR>");
}
How do I accomplish the above in a clean fashion using the logic tags?
It gets even worse when I have to accomplish:
if ( manLastName != null && !manLastName.equals("DUMMY") &&
manFirstName != null && !manFirstName.equals("DUMMY") )
{
out.println( "MP: "+manFirstName + " " + manLastName+"<BR>");
}
Ideally it would be nice if you could pass multiple parameters into a
logic property attribute like...
<logic:notEqual name="store" property="state,city,areaCode" value="">
Which in the above would check all of those properties for not being
an empty string? Is what I'm asking for possible with in struts?
Thanks for any help.
--
Rick
mailto:maillist@reumann.net
"The memories of my family outings are still a source of strength to
me. I remember we'd all pile into the car - I forget what kind it was
- and drive and drive. I'm not sure where we'd go, but I think there
were some trees there. The smell of something was strong in the air as
we played whatever sport we played. I remember a bigger, older guy we
called Dad.' We'd eat some stuff, or not, and then I think we went
home. I guess some things never leave you."
-Jack Handey
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: multiple values to check in logic tag?
Posted by Adrian Brown <ad...@yahoo.com.au>.
This probably isn't what you want to hear, but this
sounds like a great time to extend the logic tags in
your own application and create your own Custom tag.
There are a couple of examples in the example
application.
Adrian
--- Rick Reumann <ma...@reumann.net> wrote: > Is
there a way to check multiple values on one line
> using such logic
> tags like "notEqual" or "present" ? I'm trying to
> convert a JSP over
> using struts tags and it's not going so well because
> I end up having
> all these logic tags all nested within each other.
> For example say I
> don't want to display a row of state information if
> the database query
> comes back missing a city, state, or zip code. In my
> page I have:
>
> if ( city != null && state != null && zip != null)
> {
> out.println( city + ", " +state + " "
> +zip+"<BR>");
> }
>
> How do I accomplish the above in a clean fashion
> using the logic tags?
>
> It gets even worse when I have to accomplish:
>
> if ( manLastName != null &&
> !manLastName.equals("DUMMY") &&
> manFirstName != null &&
> !manFirstName.equals("DUMMY") )
> {
> out.println( "MP: "+manFirstName + " " +
> manLastName+"<BR>");
> }
>
> Ideally it would be nice if you could pass multiple
> parameters into a
> logic property attribute like...
> <logic:notEqual name="store"
> property="state,city,areaCode" value="">
> Which in the above would check all of those
> properties for not being
> an empty string? Is what I'm asking for possible
> with in struts?
>
> Thanks for any help.
>
>
> --
>
> Rick
> mailto:maillist@reumann.net
>
> "The memories of my family outings are still a
> source of strength to
> me. I remember we'd all pile into the car - I forget
> what kind it was
> - and drive and drive. I'm not sure where we'd go,
> but I think there
> were some trees there. The smell of something was
> strong in the air as
> we played whatever sport we played. I remember a
> bigger, older guy we
> called Dad.' We'd eat some stuff, or not, and then I
> think we went
> home. I guess some things never leave you."
> -Jack Handey
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
http://messenger.yahoo.com.au - Yahoo! Messenger
- A great way to communicate long-distance for FREE!
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>