Below is a code snippet from a JSP I have. I want the background colors of the rows in a table to alternate. I can make this work in scriptlet code fine but the when test below is returning false every time so that instead of alternating colors a single background color (specified by the otherwise tag) is displayed.
I'm assuming expression in the test is incorrect or I should be using a different form to represent the test but I'm not sure what that form would be. Thanks,
The only reason for time is so that everything doesn't happen all at once.
- Buckaroo Banzai
John Wetherbie
Rancher
Joined: Apr 05, 2000
Posts: 1441
posted
0
Also tried this...
but it does not appear to work either. I'm very puzzled.
John Wetherbie
Rancher
Joined: Apr 05, 2000
Posts: 1441
posted
0
Just an update... The
seems to be working fine now. Not sure why it wasn't working yesterday. Maybe Tomcat was having a problem. If the code above SHOULDN'T work please let me know. Thanks,
Originally posted by John Wetherbie: Just an update... The
seems to be working fine now. Not sure why it wasn't working yesterday. Maybe Tomcat was having a problem. If the code above SHOULDN'T work please let me know. Thanks,
This latter code should work. The code you tried first shouldn't work as such, since you can't use rtexprvalues without also using the "RT" version of JSTL taglibs. That is, you'd have to import the "c_rt" tag library, and say <c_rt:when test="<%= ... %>"> In general, I recommend using the expression language ("${ ... }"), as your second example does.
Shawn Bayern<br />"JSTL in Action" <a href="http://www.jstlbook.com" target="_blank" rel="nofollow">http://www.jstlbook.com</a>
John Wetherbie
Rancher
Joined: Apr 05, 2000
Posts: 1441
posted
0
Thanks, Shawn. Like I said, Tomcat must have been having a problem. Everything works fine now. Weird.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.