multiple charts in a page and garbled output

Harsha N
  • Harsha N
    Harsha N


        I have a page in which I have one dataproducer with a producer id; this takes a couple of parameters to produce the charts. I also have a loop that varies the parameters that are passed to the dataproducer. This looks something like this

    <% for(int i = 0; i < 10; i++) { %>
        <cewolf:chart ...>

    <% } %>

    However, the output that I get back from the server is garbled in a couple of places. I have also set up tooltips for all the charts. The expected output is the "Map" tag followed by the area tags and then finally an end MAP tag and an img tag. Thus, when everything works well, what is expected is this kind of output for each chart *one after another*. However, what is happenning is that for a couple charts, before the completion of writing the img tag of the current chart, the MAP tag of some other chart starts getting written and then somewhere down the line, the img tag is completed. Thus the output is garbled and does not render correctly in the webpage. It is almost like a thread context switching and some other thread starting to write the output and this happenning without taking locks. I am not sure what is really happening as I don't think there are multiple threads being used to process one single request from the browser to the server.

    The following is an example of the resultant page I'm seeing:

    <IMG BORDER="0" HEIGHT="200" WIDTH="210" ALT="" USEMAP="#hnChart22" src="/test/cewolf;jsessionid=4242B7<MAP name="hnChart23">
    <AREA ID="hnChart230" shape="poly" COORDS="48,137,47,140,45,140,43,140,42,137,43,135,45,134,47,135,48,137,48,137" TITLE="720.3">
    ...<!-- more area tags and map tags -->
    <AREA ID="hnChart3519" shape="poly" COORDS="193,33,192,35,190,36,188,35,187,33,188,31,190,30,192,31,193,33,193,33" TITLE="473.8">

    As you can see above, the map/area of another chart are inserted within the img tag for hnChart22.

    Any idea why this is happening and how can I go about debugging this?


    • Ulf Dittmer
      Ulf Dittmer


      I tried to reproduce this with a simple test case, but failed to do so. Can you send me a minimal code example that demonstrates the problem, both the JSP and the producer code? I'd be happy to investigate it (and try to fix it, if it turns out to be a cewolf bug).