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 / May 2007

Tip: Looking for answers? Try searching our database.

JSTL - Variable not retrieving value

Thread view: 
jill - 25 Apr 2007 14:21 GMT
I have declared a variable rowcolor. If i use c:out that works. So
following two line of code is worknig.

<c:set var="rowColor" value="even" scope="page"/>
<tr class="<c:out value='${rowColor}'/>">

But when i use below coe it does not work.
<tr class="${rowColor}">
HTML spits out  <tr class="${rowColor}"> as this
where as in c:out version it spits out  <tr class="even">

Can any body pls tell me why  <tr class="${rowColor}"> is not working.
Lew - 25 Apr 2007 14:30 GMT
> I have declared a variable rowcolor. If i use c:out that works. So
> following two line of code is worknig.
[quoted text clipped - 8 lines]
>
> Can any body pls tell me why  <tr class="${rowColor}"> is not working.

Repeating the question doesn't encourage people to answer.
Repeating the question doesn't encourage people to answer.

From your first posting of this question, in "JSTL - $variablename not working",

>> 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}">

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

> How is var="rowColor" set when the c:when condition fails?
>
[quoted text clipped - 11 lines]
>
> What is your platform?

Just out of curiosity, why did you start a new thread on the same question?

Signature

Lew

jill - 01 May 2007 21:28 GMT
> jillwrote:
> > I have declared a variable rowcolor. If i use c:out that works. So
[quoted text clipped - 52 lines]
>
> - Show quoted text -

I started a new thread because I could not see my questions posted in
the group.
jill - 01 May 2007 21:39 GMT
> jillwrote:
> > I have declared a variable rowcolor. If i use c:out that works. So
[quoted text clipped - 52 lines]
>
> - Show quoted text -

I get

${rowColor}

even

${rowColor}

odd

for following code -

<c:forEach var="list" items="${foundationAidBean.childInstitutions}"
varStatus="status">
   <c:choose>
      <c:when test='${(status.index)%2 eq 0}'>
       <c:set var="rowColor" value="even" scope="page"/>
     </c:when>
     <c:otherwise>
       <c:set var="rowColor" value="odd" scope="page"/>
     </c:otherwise>
   </c:choose>

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

</c:forEach>

So it looks my jree version is not correct.

j2se - 1.4.2
Oracle JDeveloper 10g

What version should I use for my El to work.


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



©2009 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.