• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Trying to get "contains" to work

 
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to get the JSTL contains function to work properly and color a line in the table green if "accepted" is found in the message.

Below is what I think it should be based on all the examples I've been able to find, but it doesn't match anything on the message. (If I remove the c:when test, I see messages with the 'accepted' string in them.)

What's wrong with this?

Also, can I make the contains test case insensitive?



Thanks in advance.

Mike
[ January 26, 2008: Message edited by: Bear Bibeault ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using c:when in the body of c:choose?

If you only need an if (without an else) use the
c:if tag.

Does the following example work for you?

[ January 26, 2008: Message edited by: Ben Souther ]
 
Mike London
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ben,

Thanks for your terrific reply.

The problem turned out to be that I didn't use a curly brace to surround the JSTL function.

----------------

BTW, do you know of a good reference that shows how to use every JSTL function. I have "Core JSTL", which is good, but for learning and reference, another text/website, would be useful.

Thanks again for your help!!!

Mike
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know of a great one, and it's free.
http://java.sun.com/products/jsp/jstl/reference/api/index.html

It's the only one I've ever used.
 
Mike London
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ben, I'll check it out and bookmark it!

Mike
reply
    Bookmark Topic Watch Topic
  • New Topic