JSP Worked Well Using Scripting Elements, But, Becomes a Null Using JSTL

I have to bother all of you again with my JSTL problems. I am working on a JSP, which is very similar to the one that caused a lengthy discussion on this forum before. This JSP is a bit more complicated.
Again, this JSP worked well and displayed what I expected when the page was coded using the scripting elements.
I tried to use JSTL where possible and managed to correct all the compilation errors.
Now, I got a simple message: 'null' in the browser without any explanation - typical problem working with JSP: very difficult to debug.
I have tried to identify problems "one by one" and found the first encounter is where I want to set the background color for each row inside the <c:forEach ....> tag.
I examined the code again and again, I could not see what would lead to 'null'. I need a hand again.
<%@ taglib uri="/tags/struts-html-el" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/tiles" prefix="tiles" %>
<%@ taglib uri="/tags/request" prefix="req" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ page import="org.apache.artimus.message.utility.ParamUtil" %>
<%@ page import="org.apache.artimus.message.exceptions.AssertionException" %>
<%@ page import="org.apache.artimus.authorization.OnlineUser" %>
<%@ page import="org.apache.artimus.authorization.OnlineUserImpl" %>
<%@ page import="org.apache.artimus.filter.EnableEmotionFilter" %>
<%@ page import="org.apache.artimus.message.ThreadBean" %>
<%@ page import="org.apache.artimus.message.PostBean" %>
<%@ page import="org.apache.artimus.message.AttachmentBean" %>
<%@ page import="org.apache.artimus.MessageInboxConfig" %>
<%@ page import="org.apache.artimus.WebSiteGlobal" %>
<%@ page import="org.apache.artimus.SiteUtil" %>
<c:set var="threadBean" value="${requestScope.ThreadBean}" />
<c:set var="postRows" value="${requestScope.PostBeans}" />
<c:set var="numberOfPosts" value="${requestScope.NumberOfPosts}" />
<c:set var="previousTopic" value="${requestScope.PreviousTopic}" />
<c:set var="nextTopic" value="${requestScope.NextTopic}" />
<c:set var="offset" value="${requestScope.offset}" />
<c:set var="threadID_int" value="${requestScope.thread}" />
<c:if test="${threadBean.threadID != threadID_int}">
    The two threadID are not the same.
</c:if>
<c:set var="threadID" value="${threadID_int}" />
<%-- the code before this line works fine and I have a number of things displayed as expected --%>
<c:forEach var="postBean" items="{postRows}" varStatus="i">
<% PostBean postBean =
   ( PostBean )pageContext.getAttribute( "postBean" );
%>
   <c:choose>
      <c:when test="${(postBean.parentPostID) eq 0}">
         <c:set var="background" value="#FFCE9C" />
      </c:when>
      <c:otherwise>
         <c:choose>
            <c:when test="${(i+1)%2 ne 0}">
               <c:set var="background" value="#EEEEEE" />
            </c:when>
            <c:otherwise>
               <c:set var="background" value="#FFFFFF" />   
            </c:otherwise>
         </c:choose>
      </c:otherwise>
   </c:choose>
<table width="95%" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#999999">
  <tr bgColor="${background}">
  </tr>
</table>
</c:forEach>

Where is the null occuring? Have you looked at the returned HTML code to see where the 'null' is?
You might try just a few <c:out value=""/>, like:
The postRows = <c:out value="${postRows"/><br/>
<c:forEach var="postBean" items="${postRows"/>
  The Current postBean = <c:out value="${postBean}"/><br/>
  The Current parentPostID = <c:out value="${postBean.parentPostID eq 0}"/><br/>
  <!-- Only do this set if background ends up null, to make sure the scope of background is wide enough -->
  <c:set var="background" value="#FFFFFF"/>
  <c:choose>
    <c:when test="${postBean.parentPostID eq 0}">
      <c:set var="background" value="#FFCE9C"/>
    </c:when>
    <c:when test="${(i+1)%2 ne 0}">
      <c:set var="background" value="#EEEEEE"/>
    </c:when>
    <c:otherwise>
      <c:set var="background" value="#FFFFFF"/>
    </c:otherwise>
  </c:choose>
  The Background is now = <c:out value="${background}"/><br/>
  <table width="95%" border="0" cellspacing="1" cellpadding="5" align="center" bgcolor="#999999">
    <tr bgColor="${background}">
    </tr>
  </table>
</c:forEach>By adding output like that when we are debugging we can help track down where problems that occur are coming from. That and looking at the source code have been invaluable to me...

Similar Messages

  • I am having trouble with face time , it was working well yesterday and today am not able to use it due to an error that won't let me log in !!!

    I am having trouble with face time , it was working well yesterday and today am not able to use it due to an error that won't let me log in !!!

    I have the same exact issue. There is number of these post, but still not an answer. hope someone post an answer soon

  • I recently signed up for iTunes Match.  It works well on my iPad2 but not my iPhone4S.  A while ago my music did show up but it was grayed out.  Now I don't see anything.  I've tried everything I can think of.  I'm running the latest operating system

    I recently signed up for iTunes Match.  It works well on my iPad2 but not my iPhone 4S.  A while ago my music did show up on my phone but much of it was grayed out.  Now I don't see anything on my iPhone.  I've tried everything I can think of.  I'm running the latest operating system and software

    Try the tips in this thread: iTunes Match - 'No Music' on iPhone 4

  • My photos are sharp but become soft when used in and IDVD slide show.

    My photos are sharp but become soft when used in and IDVD slide show. How can I prevent this from happining??

    Hi,
    I suggest that you try unchecking both of the crop options - landscape & portrait.
    To re-create your situation, I had to check the crop for landscape pictures option.
    I prefer to have control over any cropping so I tend to crop each image first before creating the slide show.
    Brian

  • Just purchased CC Lightroom & Photoshop following a 30 day free trial. All worked well during the trial but now I have subscribed to the plan and downloaded the latest LR version I am unable to zoom into the images and just get a constant 'loading' box an

    Just purchased CC2015 Lightroom & Photoshop following a 30 day free trial. All worked well during the trial but now I have subscribed to the plan and downloaded the latest LR version I am unable to zoom into the images and just get a constant 'loading' box and spinning circle. Also, the whole system is very slow - very frustrating! Any ideas? I am running it on Windows 8.
    Mick

    You keep asking variants on this same question. You've had replies in all your other threads. If you can't find them, go here and click where it says Activity:
    Thomas Cannon Jr.

  • I have a new Airport Extreme that works well with my IMac but is intermittent with our Windows 7 PC.  Any ideas?

    I have a new Airport Extreme that works well with my IMac but is intermittent with our Windows 7 PC.  Any ideas?

    Thanks planb77. Your instructions worked but I had to do a little more than you stated. I did not realize that transferring files to a new computer was not enough. When the iPod synced I was told I needed to "authorize" my new computer to get my iTunes purchases to sync to the iPod. So after the initial sync, I ejected and disconnected the iPod, went into the iTunes store, set up "home sharing" and then authorized the new computer. When that was done I reconnected the iPod and was able to sync all my books and music. The only thing I couldn't do was rename the iPod as iTunes never asked me to. Is there a way to rename it after it has been set by iTunes as "owner's iPod"?

  • I have a new mac book pro which i use in england but I need to use German charachters frequently, is there a way of having both visable on the keyboard?

    I have a new mac book pro which i use in england but I need to use German charachters frequently, is there a way of having both visable on the keyboard?
    For example so that I can just press shift or another key to get the German character.

    Some may already exist, but you will have to learn them.  On my old system these can be found through keyviewer.app  For example, if I press option+s I get ß   Umlaut is a bit cumbersome as option+u then the actual letter.  It may be possible to bind a key to do this function, possibly through System Preferences > Keyboard > Shortcuts
    I have old, old references for utilities that let you rebind keys to other functions, and you would have to see if they have modern equivalents.
    Ukelele Mac OS X Keyboard Layout Editor - http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=ukelele - mostly useful for character, not function mapping.
    Check Butler, ikeys, quickeys or Spark

  • We bought an iphone 4s for our daughter. We transfered it to straight talk. She can make calls and text no problem. She can use the WiFi but is unable to use the internet or mms. How do we update the APN?

    We bought an iphone 4s for our daughter. We transfered it to straight talk. She can make calls and text no problem. She can use the WiFi but is unable to use the internet or mms. How do we update the APN?

    To clarify for anyone who is still having any problems doing this.
    1. Unlock your phone with the carrier ( I know the process will work if it is jail broken but I am assuming you dont want to void the warranty on your phone) NOTE: even if you purchased the phone outright at Wal-Mart it is still locked to ATT so you will have to unlock the phone.  If it's already unlocked skip to step 2.  This works and will work even if you update the phone. 
    1a Here is the link to unlock a ATT iphone. Simply follow the instructions https://www.att.com/deviceunlock/client/en_US/
    2. Get a T- mobile SIM. Even if you don't want the service, if you feign interest, they will send you one for free or 99cents. If you need it now you can get one at a T-mobile store too.
    3. Once you have both your Straight talk SIM and your T-mobile SIM follow these instructions:http://www.youtube.com/watch?v=mFFf5uqk18M
    4. If you have any remaining questions look at all the responses posted previously on this thread or check out the Howard Forums Wiki: http://wiki.howardforums.com/index.php/Straight_Talk_iPhone
    Everything should work flawlessly at this point.  If not let me know and I'm happy to help when I can.  I hope this makes doing this very easy for everyone in the future. God Bless -J

  • I have an I phone 4 that I use in Singapore, but would like to use it in the US while on holiday. How do I cahnge out the sim card, and is there anything else that I need to do.

    I have an I phone 4 that I use in Singapore, but would like to use it in the US while on holiday. How do I change out the sim card, and is there anything else that I need to do?

    Ignore the other post (the one from Brendan), he has no idea what he is talking about.
    Read your manual (you have a bookmark to it in Safari on your iPhone or put iBooks on your iPhone and download the manual from the iBookStore) and it will show you how to remove the microSIM from your iPhone. AT&T is not tourist friendly and does not offer a pay as you go plan for visitors with an iPhone. If you are going to be here for a short time you can probably buy a pay as you go microSIM and use it before AT&T notices, if it is going to be for a long time that won't work.
    There is a 3rd party company that will sell you a microSIM that will work with AT&T but they are pretty pricey.
    Finally, you can get a pay as you go microSIM from T-Mobile to work with your iPhone but you will only have EDGE data speeds.
    Message was edited by: deggie

  • 1) (Right click) Context menu is IE's context menu(!) and when I attempt to use a sight that uses scripts (a site that I've used extensively and which I use to conduct my online college courses - application is Angel), it goes blank

    1) (Right click) Context menu is IE's context menu(!) and (2)when I attempt to use a sight that uses scripts (a site that I've used extensively and which I use to conduct my online college courses - application is Angel), it goes blank
    == This happened ==
    Every time Firefox opened
    == 2 days ago ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; WWTClient2; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Creative AutoUpdate v1.10.10)

    Previous post from "Not Anonymous" but from the original poster; I used the link provided in the email notification and now have to indicate who I am???
    Thanks; starting FireFox in safe mode and disabling all add-ons did solve the problem; however, a new problem has emerged. To re-enable the add-ons, you need to open up and use the add-ons control panel through FireFox. Any attempt to do so causes the FireFox add-on control page to close immediately.
    Thanks for your help.

  • Can I use Photoshop Elements 10 for RW2 files used by Panasonic?

    Can I use Photoshop Elements 10 for RW2 files used by Panasonic?
    Message title was edited by: Brett N

    PSE supports RW2 from the Lumix DMC-GH1

  • Does anyone know of a good online video instruction on how to put together a photo slideshow in the new iMovie version. I found uTube videos using imported videos, but I want to use photos in iPhoto.

    Does anyone know of a good online video instruction on how to put together a photo slideshow in the new iMovie 11 version. I found uTube videos using imported videos, but I want to use photos in iPhoto. I'm very familiar with how to do this in the pervious version, but it's no so intuitive in the new version.

    Has anyone tried this one.. I am not sure if I am allowed to post information about other products... so if I am not please delete this part of my message.
    New Trent Arcadia Pack IMP70D 7000mAh?

  • I burned an edited movie to disc using H.264 codec and a second movie to MPEG -4 Video both worked well on my iMac but will not play on my Sony DVD Recorder/Player which accepts both DVD RW and DVD-RW.  Any suggestions?

    I burned an edited movie to disc using H.264 codec and a second movie using MPEG-4 Video.  Both played well on my iMac but would not play on my Sony DVD Recorder/Player which accepts both DVD+RW and DVD-RW discs.  I have tried other 'codecs' DV-PAL; DVCPRO-PAL; DVCPRO50-PAL; AIC; and finally share to iDVD.  iDVD works on both my iMac and DVD Recorder but the picture is very poor with major shimmering which is unwatchable.  Can anyone assist? The other codecs I used either do not pay on my video recorder or fail when I play them back on my iMac.  I am at a loss as to what I can do.  I am from the UK so using PAL is essential.

    If the source video is interlaced, you may have problems using iMovie. It de-interlaces everything on output which can cause picture to look strange.  Final Cut Pro X supports interlaced video, but it costs a lot more.
    Standard DVD Players don't support H.264 or MPEG4.  You might want to look at this article on transferring HD video to DVD.  I wrote this article mainly for Final Cut Pro, but many of the same principles apply.  

  • Html page works well in firefox & safari but not in IE 7

    Hello,
    This is my first time using html and the page i created works
    well in firefox and safari but not at all in IE7.
    I know I shouldn't do this (this is probably a sin) but I
    converted a PDF file to HTML in Acrobat and then took the HTML file
    into Dreamweaver to add a couple of hotspots and uploaded it onto a
    server. No problems in firefox and safari but when I open it in
    IE7, I don't see anything except for a thin line across the top and
    nothing else.
    I promise I will learn HTML soon but for now I really need
    this page to work across all browsers.
    Does anyone know how I can fix this?
    Here is the link to the page and the source code(bottom)...
    html page
    If anyone can help me, i'd really appreciate it... thank you
    in advance.
    J

    You are not using the latest Spry files
    The latest version of the Adobe Spry Framework is 1.6.1, this is the same version that ships with Dreamweaver CS4. If you use Dreamweaver CS3 (uses Spry 1.4), its wise to upgrade your files to the latest version. This can easily be done using the Spry Updater that can be found here.
    Then, if you have a look near the bottom of SpryMenuBarVertical.css you will see that the white background colour has been specified for IE as in
    @media screen, projection
        ul.MenuBarVertical li.MenuBarItemIE
        display: inline;
        f\loat: left;
        background: #FFF;
    Change the value to #CCC and it will have fixed that part of the problem.
    When you upgrade to the later version of Spry, make sure to keep a copy of the CSS file as a reference to modifying the new CSS file.
    Gramps

  • Work well in my mini but not in my iMac 27". Only difference is 27" with CS5 , are there any concerns?

    My mini works well with Lion but my 27" iMac always stop some where. I did install two times and restore to SL because I want new thing but I have to work. The difference between two computer sis just the iMac with CS5 but the mini don't. Any concern ?

    I don't really have a suggestion, other than to point out that others have had problems with CS5 in Lion.  You did not describe your problems, and I don't use Adobe CS, so I have no idea whether that might be the cause in your case.  If the problems people describe with CS5 match your problems, then you may want to update to CS5.5.

Maybe you are looking for

  • Incorrect value of Auto.Gain/Loss Forex during GRIR Clearing

    Dear Experts, We have activated the Material Ledger functionality. The Document Currency of PO, GR, and IR are in Foreign Currency. The postings are below: Loc Currency 1 = USD Loc Currency 3 = IDR Doc currency = IDR GR Dr Material                  5

  • Windows 8.1 (full version) Not Installing- Error Code 0x80040155

    Was downloading windows 8.1 overnight expecting to complete in the morning and it did not. Had to go to work so I disconnected and stopped the download. I went home and tried to continue the download/install and it gives me an error: 0x80040155 This

  • Delete Routing CA03

    Hi All, I need to delete the routing data from transaction CA02. If any one know any FM it will be very helpful to me. Thanks Subhankar

  • NullPointerException . . .  problem. in Array

    i make a class UserData.java package server; import java.io.Serializable; public class UserData implements Serializable   { private String name; private String id; private String add; public UserData() { name = ""; id = ""; add = ""; public String ge

  • Looking to create file based socket server (like mysql.sock)

    Hello, I am fairly new to Java and have been trying to find the way to develop a very simple socket server, but one that listens/writes to a file rather than something that is bound to a port number. This would be like mysql.sock type functionality w