Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

noob needs string comparison help  RSS feed

 
Steve Noll
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all. I've been doing a lot of google searches but so far I haven't had any luck. Let me start off my saying that I have 0 jsp/jstl experience. I'm decent with php but my employer needs me to update a portion of our web site written in jsp. So with that being said, here's what I need to do...

I need to write an if statement that checks the value of a message string to see if it contains a string of text. If it does, then I need to insert a new font tag to the html output. That's it.

I've tried several different syntaxes, here's one of my best guesses that still didnt work:

I know that's pretty ugly, but hopefully it'll give you an idea of what i'm trying to accomplish. Thanks for any/all help!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Font tag? Is this app from 1998?

In any case, we need to know what version of JSP you are using to be of any assistance. You mentioned JSTL, are you running JSP 2.0 with JSTL 1.1? (You really really want to be, trust me).
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Umm, Steve... you changed your display name and it's no longer valid. First and last name please!
 
Steve Noll
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright I've added my last name to my profile. If you'd like I can change it to <span class="red-font"> ;)

The issue is the message variable (named message) is stored in a <td> tag. The message variable could have one of several values. The only time I want the message to be displayed in red is if the message indicates an invalid login to the user. "Thank you for logging in" "You have successfully logged out", etc. should be displayed in the normal dark gray font color.

How could I figure out what version of JSP/JSTL I'm running? All I know is that we're running a Resin server on windows 2003. Where could I look to figure out exactly what version I'm running?

Thanks!

[ December 11, 2007: Message edited by: Steve Noll ]
[ December 11, 2007: Message edited by: Steve Noll ]
 
Steve Noll
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am the smartest man alive! well no, not really, but I did manage to figure it out:

Thanks!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Steve Noll:
How could I figure out what version of JSP/JSTL I'm running? All I know is that we're running a Resin server on windows 2003. Where could I look to figure out exactly what version I'm running?

What version of Resin?

P.S. You keep mentioning the JSTL, but your code uses scriptlets not JSTL.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!