Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

JSTL - $variablename not working

Thread view: 
jill - 24 Apr 2007 22:04 GMT
Please let me know why below code is ot worknig and how to solve it.

<c:choose>
    <c:when test='${(status.index)%2 eq 0}'>
     <c:set var="rowColor" value="even" scope="page"/>
   </c:when>
 </c:choose>

<tr class="${rowColor}">

I get "${rowcolor}" in html for above line of code --  <tr class="$
{rowColor}">
.

But <c:out value="${rowColor}"/> is worknig fine.

So my question is how to display rowcolor in for class with c:out?
Lew - 25 Apr 2007 13:11 GMT
> Please let me know why below code is ot worknig and how to solve it.
>
[quoted text clipped - 8 lines]
>  I get "${rowcolor}" in html for above line of code --  <tr class="$
> {rowColor}">

I doubt it very much.  I would believe you got "${rowColor}", though.

> But <c:out value="${rowColor}"/> is worknig fine.
>
> So my question is how to display rowcolor in for class with c:out?

How is var="rowColor" set when the c:when condition fails?

Your question would be easier for us to approach if you posted an SSCCE.

You might be working with a version of JEE that only accepts EL in JSTL
constructs.  Since <tr> is not a JSTL tag, it wouldn't parse the EL expression
in that scenario.

Compare
<p>${rowColor}</p>
<p><c:out value="${rowColor}"/></p>

in a test page (which you could post as an SSCCE).  What do you get?

What is your platform?

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.