ChartRenderer Jsp refresh

I have a chart using ChartRenderer data web bean in a Jsp deployed to tomcat. My chart works fine, but when the data changes making up the chart I have to resart the browser to refresh the chart. My BC4J view object used in the chart is based on a view (not table) which I create dynamically on the fly just before the chart is rendered. Any tips or tricks to have my chart display the refreshed data ??

Do you re-execute the viewObject's query?
This behavior can come from various sources:
1/ BC4J caching.
After a view object's query has been executed, its data is retrieved from the internal BC4J cache and not directly from the database.
-> In order to refresh the cache with current dataBase data, you should re-execute the appropriate view object's query (ViewObject.executeQuery()).
2/ Browser caching: your browser stores the rendered picture the first time it is requested and then gives you the stored picture in next requests instead of going all the way to the jsp.
-> In that case you have to include the proper pragma tags in your jsp in order to prevent your browser from caching the data/
<%
response.setDateHeader( "Expires", 0);
response.setHeader( "Pragma", "no-cache");
if( request.getProtocol().equals( "HTTP/1.1")) {
response.setHeader( "Cache-Control", "no-cache");
%>3/ Proxy caching: if your web server is accessed through a proxy, it can cache some pages as well.
-> I think the code above prevents proxy caching as well (not too sure about this though).
As you have already checked browser caching, It is likely that your problem lies with BC4J caching.
If I understand well, what's happening to you is: when you restart the browser, you lose your current JSP session, which holds the references to the appmodules used in this session.
Therefore, when you re-connect, the appModule pool looks for a free appModule instance to give you, most likely doesn't find one, and creates a new instance.
In this new instance, the view object's query hasn't been executed yet, therefore when you try to use it, the query is automatically executed, retrieving data from the database, and using it to populate this instance's cache.
Subsequent queries to the same appMod will retrieve data from the cache, as the viewObject's query has already been executed.
Hope this Helps, Remi
null

Similar Messages

  • Weblogic.refresh meet exception(Jsp refresh)

              Hi all,
              I intend to make my new JSP files in effect immediately,so I used "weblogic.refresh"
              utility to implement it. The command line is showed below. I think the call to
              weblogic.refresh successful. But from the weblogic system output, I see java.io.IOException.
              Every time I do "weblogic.refresh", the exception message is generated. I believe
              that the exception cause my new JSP files not be refreshed in Weblogic managed
              server. Any one here give me idea?
              Thanks.
              Weblogic.refresh Command line:
              ======================
              D:\>java weblogic.refresh -url t3://localhost:7001 -username system -password
              12345678 -application DefaultWebApp -component DefaultWebApp -root d:\bea\wlserver6.1\config\mydomain\applications\defaultwebapp
              zjdx\jsp\news_info\news_info.jsp
              Connected to Server:t3://localhost:7001
              Refreshing files in WebAppComponent:'DefaultWebApp' in application:'DefaultWebApp'
              ======================
              Weblogic system output:
              ======================
              java.io.IOException: Unable to overwrite file: D:\bea\wlserver6.1\.\config\mydomain\applications\DefaultWebApp\zjdx\jsp\news_info\news_info.jsp
              at weblogic.utils.jars.JarFileObject.extract(JarFileObject.java:136)
              at weblogic.management.servlet.FileDistributionServlet.extractArchive(FileDistributionServlet.java:717)
              at weblogic.management.servlet.FileDistributionServlet.doPost(FileDistributionServlet.java:166)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2546)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2260)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              ======================
              

    Winston, I just tried to run weblogic.refresh with sp3 and got a similar
              problem. Can you please open a case with BEA support at
              http://support.bea.com/welcome.jsp. We'll take a closer look into this.
              Regards,
              Joseph Nguyen
              BEA Support
              "Winston Geng" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi all,
              >
              > I intend to make my new JSP files in effect immediately,so I used
              "weblogic.refresh"
              > utility to implement it. The command line is showed below. I think the
              call to
              > weblogic.refresh successful. But from the weblogic system output, I see
              java.io.IOException.
              > Every time I do "weblogic.refresh", the exception message is generated. I
              believe
              > that the exception cause my new JSP files not be refreshed in Weblogic
              managed
              > server. Any one here give me idea?
              >
              > Thanks.
              >
              > Weblogic.refresh Command line:
              > ======================
              > D:\>java weblogic.refresh -url t3://localhost:7001 -username
              system -password
              > 12345678 -application DefaultWebApp -component DefaultWebApp -root
              d:\bea\wlserver6.1\config\mydomain\applications\defaultwebapp
              > zjdx\jsp\news_info\news_info.jsp
              > Connected to Server:t3://localhost:7001
              > Refreshing files in WebAppComponent:'DefaultWebApp' in
              application:'DefaultWebApp'
              > ======================
              >
              > Weblogic system output:
              > ======================
              > java.io.IOException: Unable to overwrite file:
              D:\bea\wlserver6.1\.\config\mydomain\applications\DefaultWebApp\zjdx\jsp\new
              s_info\news_info.jsp
              > at
              weblogic.utils.jars.JarFileObject.extract(JarFileObject.java:136)
              > at
              weblogic.management.servlet.FileDistributionServlet.extractArchive(FileDistr
              ibutionServlet.java:717)
              > at
              weblogic.management.servlet.FileDistributionServlet.doPost(FileDistributionS
              ervlet.java:166)
              > at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
              > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              > at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :265)
              > at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :200)
              > at
              weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
              ntext.java:2546)
              > at
              weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
              :2260)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              > ======================
              

  • JSP refresh from servlet.

    Hi everyone
    I'm creating a web application that is a combination of jsp pages and servlets.
    On one of the jsp pages I add contact details of a person in a form, then when submitted it goes to the servlet which adds the new contact into the database,
    after the servlet entered the data it redirects to the ContactList.jsp page, but it doesn't show the newly created user, I need to refresh the page manually to see the users.
    How can I from the servlet when I redirect to the ContactList.jsp page, refresh the ContactList.jsp page to show the newly created contacts well?
    Here is the servlet which gets called when I submit the jsp form.
    package contacts;
    import javax.servlet.*;*
    *import javax.servlet.http.*;
    import java.io.*;*
    *import contacts.*;
    public class NewContactServlet extends HttpServlet
         public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
              res.setHeader("Expires", "Tues, 01 Jan 1980 00:00:00 GMT"); //no cache allowed
              Contacts contacts = new Contacts();
              ContactsData contactsData = new ContactsData();
              contacts.setContactName(req.getParameter("contactName"));
              contacts.setCompany(req.getParameter("companyName"));
              contacts.setWorkNumber(req.getParameter("workNum"));
              contacts.setCellNumber(req.getParameter("cellNum"));
              contacts.setFaxNumber(req.getParameter("faxNum"));
              contacts.setEmail(req.getParameter("email"));
              contacts.setCountry(req.getParameter("country"));
              contactsData.addContact(contacts);
              res.sendRedirect("ContactList.jsp");
    }

    Hi manuel.leiria
    Here is my code for refreshing the jsp, it is working.
    Just tell me what you think, if it's the right way.
    The servlet that sets the attribute
              session.setAttribute("contactsSession","add");
              res.sendRedirect("ContactList.jsp");The jsp page that gets the page.
              <%
              String refreshSession = (String)session.getAttribute("contactsSession");
              if(refreshSession != null && refreshSession.equals("add"))
                   %>
                   <body onload="window.location.reload(true);">
                   <%
                   session.removeAttribute("contactsSession");
              else
                   %>
                   <body>
                   <%
              %>

  • Iframe, jsp & refresh/reload issues

    Good Morning,
    I have a problem with iframe, this is what happend:
    I'm using a code like this one
    ...some html code...
    <iframe src="myPage.jsp"></iframe>
    ...some code here too...myPage.jsp has a form, I sumbit the form and then if something will happen I redirect to newPage.jsp.
    Well, now, if I'm on newPage.jsp, if i try to reload this page using F5 or the browser button the page that will be reloaded is myPage.jsp and not the page I was seeing.
    Does anyone know why?
    Thanx a lot,
    Omar

    You are actually refreshing the outer page that contains the iframe, which will send a new request to myPage.jsp in order to fill in the iframe. If you need the functionality of refreshing outer page does not reset the inner page to the default, you will have to store the page that is supposed to be displayed in the iframe as a variable in the user's session. Have it default to myPage.jsp.
    //In the page that contains the iframe...
    <%
      String iframePage = (String)session.getAttribute("iframePage");
      if (iframePage == null) {
        iframePage = "myPage.jsp";
        session.setAttribute("iframePage", iframePage);
      iframePage = response.encodeURL(iframePage);
    %>
      <iframe src="<%=iframePage%>"></iframe>Then when something happens that makes it go to myPage.jsp, change the variable in session to newPage.jsp.
    //someplace where the myPage.jsp form is processed ...
      String iframePage = "newPage.jsp";
      session.setAttribute("iframePage", iframePage);
      iframePage = response.encodeURL(iframePage);
      response.sendRedirect(iframePage);You will have to know when to remove the variable from the session, or reset it back to the default value...

  • JSP refresh problem

    hi
    i am developing a webiste with mysql database.
    i want to display the data from mysql database using jsp.
    if the value is updated into mysql table. i want to update in jsp page
    is there any technology to update the information from database.
    can any body guide me.
    thanks
    Prakash

    You can't pull information from the server to the client. The client have to request for information so that the server can send response to it. Best what you can do is to add a meta refresh tag to the HTML head so that the page refreshes itself every interval as set in the refresh tag. This will fire a new request to the server everytime. If you want to do this transparently (asynchronously), then consider ajaxical techniques.

  • JSP Refresh

    Hi,
    I have three JSPs. My first page is calling second JSP and second page is calling third JSP. When user is in second JSP I want to refresh first JSP.
    Can anybody tell me how to do it ?
    Thanks in advance.
    -Priya

    Priya,
    First thing I am not getting that why do you want to do it? when you are displaying second jsp page, what is the need of refreshing first page?
    Basically jsp is used to display html page with database content. If first jsp page is not viewed, I don't think there is need of refreshing that page.
    If you want to take the values from first jsp page into second jsp page, use request.getParameter("FIELDNAME");
    I think this will help you.
    Sameer

  • JSP Refresh Problems with Weblogic 8.1

    While Integration testing with Weblogic 8.1, when I make any changes in the Java classes (like interface changes), the JSPs are not able to recognize them. If the interface being used by a JSP changes, the JSP starts giving compilation errors. The other Java classes of the project though, run fine with the changes.
    Have wasted a lot of time in this situation . PLEASE ANY1 HELP!!!
    regards,
    SR

    Not sure on the first problem, store-version-in-cache is a valid element. Make sure you are using the same version of the Mapping Workbench and the runtime library. Please attach the XML for the version locking policy that was generated and the error message.
    The abstract method error seems to indicate that the setFetchSize method is missing on your driver.
    setFetchSize has been part of JDBC and JDK since JDBC 2.0/JDK 1.2, how old is the driver that you are trying to use? I noticed the COM is uppercase, so I assume this is a very old driver, can you use the more update version? TopLink requires JDK 1.3 support as a minimum.

  • Passing values from javascript in pop up window to parent jsp

    Hi
    I am trying to pass values from a pop up window to the main window that popped this child window , with the idea to have the parent window refresh itself with value from pop up window.But the values are not going through.I do a request on the hidden variable but when the parent
    jsp refreshes , the variable is still null...
    The following is the code i have .
    Parent jsp:a.jsp
    <form name='summary'>
    <input type=hidden name=customerid value="">
    <input type="button" class="textButton" name="action" value="customerlist" onClick="javascript:openWin('b.jsp','800','350')">
    <script>
    function openWin(loc, w, h) {
    var newWin = window.openloc,"HTML",'dependent=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=' + w + ',height=' + h);
    newWin.window.focus();
    </SCRIPT>
    <%
    String optionVal = request.getParameter("customerid");%>
    var user = "<%= optionVal%>";
    </form>
    child jsp- b.jsp (pop up window)
    <script>
    function closer(){
    var val = document.formname.id.selected.value;
    window.opener.document.summary.customerid.value = val;
    window.opener.location.reload();
    </script>
    <form name = formname>
    <input type="text" name="id" value = ''>
    <input type="button" class="textButton" value="select"
    onClick="closer();window.close();">
    </form>
    Any ideas on what i am missing
    Thanks
    Arn

    use window.opener.document.forms[0].filedname.value = 'value u need to set'

  • JSF - CommandLink action - Partial Refresh for Multiple Pages in a Form

    Hi,
    I have a 3 JSP Pages, say ( 1.jsp, 2.jsp, 3.jsp) called as designed in the FORM below :
    --------------PAGE 1.jsp-----------------------------------------
    | Input Box 1 |
    | Input Box 2 |
    | Input Box 3 |
    | |
    | <DIV> |
    | PAGE 2.JSP |
    | </DIV> |
    | |
    | |
    | |
    | <DIV> |
    | PAGE 3.jsp |
    | </DIV> |
    |________________________________________ |
    Page 1 has some input boxes and onBlur() of one of the input Boxes --> I call some Ajax code pass Values from Page 1.jsp to Page 2.jsp --> build URL for Page 2.jsp and display it in the specifiedDIV area above.
    Similarly, Page 2.jsp has some inputs --> pass inputs from Page2 to Page 3----> build URL for Page 3.jsp and call it in DIV areaabove .
    Now,
    Page 3.jsp has a commanButton which I click and upon success submission refreshes the whole screen & loads only Page 3.JSP
    Is there a way that when i click on the submit button on Page3.jsp above, only the part of the whole form that has Page 3.jsp refreshes and rest of the screen remains as it is. I mean Page 1 & Page 2 do not get refreshed.
    I would really appreciate if you could assist with some code examples

    Don't know if I get it right, but it's not wise to discover wheel, when it's alredy discovered. Mix of JSF 1.2 with RichFaces should do. You can set form to be submited in ajax, you have ajax components, finally you have attribute 'reRender' in commandButton (or whatever you use) which tells which part of page should server rerender, so just indicate it by element id :].
    In short term You may try to divide your page with sub pages (suppose you use subview) on 3 forms. In JSF 1.2 RI h:form always send whole form, and so rerenders whole form

  • Memory leak with jsp and beans

    The application we have created has one particular page that is designed to stay up in the browser and refresh with new information from database queries once every 60 seconds. Running with Tomcat3.2.1 and IE5.5
    The problem is that the memory usage of java.exe continues to grow until the machine crashes from out of memory. It does take more than 24 hours to crash.
    Things I have tried to do to track down the problem or eliminate the problem.
    - I have explicitly set the scope of the beans to "page"
    - I have watched the DatabaseAccess.class (the beans are all extended from this class) and put in code to watch how many instantiations of the class are made and subsequently garbage collected. This appears to be where the memory leak may reside - hundreds of instantiations from some other source than the page I am displaying.
    - the top frame makes database queries for security and display of a menu system dependant upon security clearance. It does not set any time for refresh (refresh == 0). Nor does it explicitly set a scope for the beans.
    - I have run a different jsp engine to see if this was directly related to Tomcat - same problem with resin2.0.0
    The main jsp page that is in the bottom section of the page has the following code:
    ** only the relevant lines are included here
    <%@ include file="../../common.jsp" %>
    <%
         refresh=60;
    %>
    <head>
    <%@ include file="../../meta_head.jsp" %>
    </head>
    <body bgcolor="#FFFFFF" text="#003399" link="#660099" vlink="#990099" alink="#006666" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <%@ include file="../../access.jsp" %>
    <%@ include file="../../page_title.jsp" %>
    <jsp:useBean id="Line" class="jsp.Line" scope="page" />
    <jsp:useBean id="Machine" class="jsp.Machine" scope="page"/>
    <jsp:useBean id="Alarm_log" class="jsp.Alarm_log" scope="page"/>
    contents of meta_head.jsp
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <META HTTP-EQUIV= "expires" content = "0">
    <META HTTP-EQUIV="Pragma" CONTENT="no_cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache" forua="true">
    <META NAME="robots" content="NOINDEX,NOFOLLOW">
    <%
    if (refresh > 0)
    %>
    <meta http-equiv="Refresh" content="<%= refresh %>">
    <%
    If anyone has some suggestions on how to trap this memory leak, it would be terrific. Or, some other things to try to stop the instantiation of the DatabaseAccess object (perhaps setting the scope of the beans in the header to "session" or "application"?).
    Thanks in advance.
    Roberta

    jsp:useBean tags scope declaration :
    page = Create a new instance on each load.
    session = Load instance from the session, if not there, create one
    application = Load instance from the ServletContext, if not there, create one.
    Not sure how you are populating the data variables, but make sure you are closing all ResultSet, (Prepared)Statement, and Connection objects.

  • JSP page not refreshing in browser

    Everytime I edit a JSP file, and try to refresh the JSP in the browser, I don't get an updated version... just the original page that I viewed first. Anyone got a solution?
    I tried deleting the work directory under the %tomcatHome% directory, and that seems to work until I view the page, and tomcat creates this work directory again. So when I try to refresh the page, because the work folder is still there, the page does not get refreshed. Weird... any solutions? Thanks again.

    I'm not sure if your using Tomcat or not but if you are give this a try:
    The ROOT context is the default Web application in Tomcat, and is convenient to use when you first learning about servlets and JSP (although you'll use your own Web applications once you're more experienced). The default Web application is already enabled in Tomcat 3, Tomcat 4.0.1-4.0.3, and Tomcat 4.1. But, in Tomcat 4.0.4 it is disabled by default. To enable it, uncomment the following line in install_dir/conf/server.xml:
    <Context path="" docBase="ROOT" debug="0"/>
    Taken from: http://www.moreservlets.com/Using-Tomcat-4.html#Enable-Root-Context
    This will make the server request a new page every time, not recommended for production apps but for development it will make life easier.

  • Passing javascript values to jsp without refreshing the page

    Hi,
    How do u pass a value of a javascript variable to the jsp without refreshing the page ?
    For example, a file called test.jsp in which a javascript variable x contains value 254. I need to pass the value of x to a method declared in test.jsp(same page).

    Hi Mona,
    when i say refresh i do mean a blink of the browser.
    This is a small example i wrote to show you how you can pass javascript varables to JSP variables. If you don't want the refresh to be seen by the user just include this code in a hidden frame on a page and instead of refreshing the entire page, refresh the hidden frame.
    i have to say, i didn't test the code so i don't guarantee it's flawless.
    if you need an more detailed example just tell me, i'll create one, but it won't be for today :)
    <html>
    <head>
         <title>Log in to the system</title>
    </head>
    <body>
    <script>
    //we retrieve the parameter 'user' from the URL
    <%
      String username = request.getParameter("user");
    %>
    var user = "<%= username%>";
    //check if there is a username in the URL
    if(user=="null")
      //there is no username so we log the person in as a guest
      user="guest";
      //we refresh the page and set the user parameter to 'guest'
      //the parameter now contains the javascript variable 'user'.
      //The parameter can be read by the JSP (see the top op this script).
      //This way we gave the javascript variabele to the JSP variable
      location="login.jsp?user="+user;
    else if(user=="guest")
    {  alert("Welcome "+user+", I hope you like this site"); }
    else
    {  alert("Welcome "+user+", I'm glad to see you again"); }
    </script>
    </body>
    </html>

  • Hyperlinked JSP Page does not refresh contents

    I have a very typical problem.
    In my application whenever I call a jsp page using hyperlink without any querystring attached to it the page called does not refresh. However when I press refresh on the browser it does refresh the contents. Basically in this page I am using some session variables to fetch data. So I do not call the page by passing querystring instead set the attributes of session variables and then the page is called as a hyperlink.
    However if I call the same page using submit the values are refreshed.
    Help on this urgently will be appreciated.
    Thanks
    Manish

    Just set 'no-cache' option for the jsp page and test it. It should work. only you need to do is
    response.setDateHeader("Expires",0);
         response.setHeader("Pragma","no-cache");
         if(request.getProtocol().equals("HTTP/1.1")) {
              response.setHeader("Cache-Control","no-cache");
    have fun!!
    ---rajsekhar

  • Refreshing the Content on a JSP page

    Hi,
    I am developing an application where a JSP page (index.jsp) is displaying some data from the database. There is an HTML form on the JSP page too. When the user fills in the data and clicks submit, he is redirected to a servlet (via form's action)... the servlet inserts the data into the database and the user is redirected back [Response.sendRedirect("index.jsp")] to the original JSP page.
    The problem I am facing here is that when the user is back on the original index.jsp page, the newly inserted data is not being displayed on the page. The user MUST refresh the page manually in order to view the new data.
    How can I display the new data automatically, without the user refreshing the page?
    PS: I have already tried <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">... but it is not working...
    Any help will be greatly appreciated.
    Thanks.

    Thanks for info... Have you got any idea of dynamic updation of JSP page? I have been debugging the problem since 2 days and I have tried various methods but nothing seem to help. I have tried to use meta http-equiv and javascript as well for the refresh but its of no use...
    My business logic is pretty simple...
    index.jsp
    =======
    [Connect to database]
    [Fetch  & Display data]
    [HTML Form] ---> submit to Servlet 'test'
    test.java (Servlet)
    ======
    [Fetch the request parameters sent by JSP page]
    [Insert the record into database]
    [response.sendRedirect("index.jsp");]

  • Need to refresh the jsp page

    Hello Everyone,
    I am not sure if I can tackle the below issue with just html or I need to control it throught my servlet, so posting it on this forum, in case it is a pure html issue, please let me know.
    So here is the current situation:
    My jsp page gets data from servlet and displays it in a html table. The fields are criteria, median, average...cells of average, median etc are color coded, green, yellow or red, depending on whether the criteria is met or not.
    on wish list:
    I want the column "criteria" to be of text type so that the user can change the criteria value and see what effect does it have on the colors of columns "average", "median" etc. I do not want to write this changed criteria value back to db, I just want my jsp page to refresh every time user changes value in criteria text box and recalculate the color code for the rest of the columns.
    Here is what my jsp page looks like
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib uri="http://paginationtag.miin.com" prefix="pagination-tag"%>
    <html>
    <body>
      <table border="1">
        <c:forEach items="${sheetDataList}" var="releaseData">
        <tr>
          <td align="center"><input type="text" name="newcriteria" value="${releaseData.releasecriteria}" size="25"></td>
          <c:set var="yellowmark" value="${0.25*releaseData.releasecriteria+releaseData.releasecriteria}"/>
          <c:choose>
            <c:when test="${releaseData.average lt releaseData.releasecriteria}">
              <td bgcolor="green" align="center"><c:out value="${releaseData.average}"/></td>
            </c:when>
            <c:when test="${releaseData.average lt yellowmark}">
              <td bgcolor="yellow" align="center"><c:out value="${releaseData.average}"/></td>
            </c:when>
            <c:when test="${releaseData.average gt yellowmark}">
              <td bgcolor="red" align="center"><c:out value="${releaseData.average}"/></td>
            </c:when>
          </c:choose>
      </table>
    </body>
    </html>Thanks.

    I don't know what you are doing wrong in your code, but it seems like you are calling the JS function correctly. My feeling is there is some JS error occurring, maybe use a javascript debugger or some alerts to see where the problem is. I made as close a copy of your code I could (with some improvised improvements for keeping track of row counts and accessing the the values for the first 2 columns of the table). At the top I filled to Lists with data so I could cycle through the rows and columns. Then I do the JavaScript and the CSS, followed by the table generation.
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%
        java.util.List<java.util.List<luke.steve.RowObject>> sheetDataList = new java.util.ArrayList<java.util.List<luke.steve.RowObject>>();
        for (int r = 0; r < 10; r++) {
            java.util.List<luke.steve.RowObject> userActionData = new java.util.ArrayList<luke.steve.RowObject>();
            for(int c = 0; c < 5; c++) {
                 userActionData.add(new luke.steve.RowObject());
            sheetDataList.add(userActionData);
        request.setAttribute("sheetDataList", sheetDataList);
    %>
    <html>
      <head>
        <script type="text/javascript">
        <!--
          function setAllColors() {
            var currentRow = 1;
            var row = null;
            while((row = document.getElementById("row"+currentRow)) != null) {
              setColors(currentRow);
              currentRow++;
          function setColors(currentRow)
            var criteria = document.forms[currentRow-1].criteria.value;
            var yellowLine = 1.25 * criteria;
            var row = document.getElementById("row"+currentRow);
            var currentCol = 2;
            do {
              var col = row.cells[currentCol];
              var colValue = col.innerHTML * 1;
                   if (colValue <= criteria)  col.className = "green";
              else if (colValue < yellowLine) col.className = "yellow";
              else                            col.className = "red";
              currentCol = currentCol + 1;
            } while(row.cells[currentCol] != null);
        //-->
        </script>
        <!-- Make the clock look the way you want it to. -->
        <style type="text/css">
          .green
           background-color: green;
          .red
            background-color: red;
          .yellow
            background-color: yellow;
        </style>
        <title>Color Switcher</title>
      </head>
      <body onload="setAllColors();" onunload="">
        <table border="1">
          <tbody>
            <c:forEach var="userActionData" items="${sheetDataList}" varStatus="rowCounter">
              <tr name="row${rowCounter.count}" id="row${rowCounter.count}">
                <td>${userActionData[0].userAction}</td>
                <td><form onsubmit="setColors(${rowCounter.count}); return false;"><input name="criteria" type="text" value="${userActionData[0].releaseCriteria}"/></form></td>
                <c:forEach var="releaseData" items="${userActionData}" varStatus="colCounter">
                  <td>${releaseData.ninetyPercentile}</td>
                </c:forEach>
              </tr>
            </c:forEach>
          </tbody>
        </table>
      </body>
    </html>I made a dummy class called luke.steve.RowObject to hold the data (represents on releaseData object). The class just generates a bunch of random numbers for this test:
    package luke.steve;
    public class RowObject {
         public Integer getReleaseCriteria() {
              return Double.valueOf(Math.random()*500.0).intValue();
         public Integer getNinetyPercentile() {
              return Double.valueOf(Math.random()*500.0).intValue();
         public String getUserAction() {
              return "Action "+Double.valueOf(Math.random()*10.0).intValue();
    }In this example it works in FF3 and IE7 (though it looks nicer in FF3).

Maybe you are looking for