• Post Reply Bookmark Topic Watch Topic
  • New Topic

Trying to get "contains" to work  RSS feed

 
Mike London
Ranch Hand
Posts: 1441
8
  • Mark post as helpful
  • send pies
  • 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 ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
Ranch Hand
Posts: 1441
8
  • Mark post as helpful
  • send pies
  • 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 Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
Ranch Hand
Posts: 1441
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ben, I'll check it out and bookmark it!

Mike
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!