Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

de.laures.cewolf.taglib.tags.ParamTag.doEnd..

Help
Fabio RAM
2006-08-11
2013-01-13
  • Fabio RAM
    Fabio RAM
    2006-08-11

    Hi Folks,
    Congratulations for cewolf, it's amazing.
    I need a little help on this...please
      I install cewolf on a server with this config:

    /opt/tomcat4/jakarta-tomcat-4.1.24/webapps/myapp/cewolf
    Everithing on tutorial was did include the copy of jar files to my WEB-INF/lib

    machine:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/myapp/WEB-INF/lib# ls
    classes12.zip.old           servlet.jar
    batik-awt-util-1.6.jar      cewolf-1.0-bundle-2.jar     commons-fileupload-1.0.jar  teste.sh
    batik-dom-1.6.jar           cewolf-1.0.jar              commons-logging-1.0.4.jar  
    batik-svggen-1.6.jar        classes12.jar               jcommon-1.0.0.jar         
    batik-util-1.6.jar          classes12.jar.old           jfreechart-1.0.0.jar       
    batik-xml-1.6.jar           classes12.zip               ojdbc14.jar                 xmlparserv2.jar
    machine:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/myapp/WEB-INF/lib#

    The classes are in
    machine:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/myapp/WEB-INF/classes/de/laures/cewolf/example/
    PS: Include example classes like PageViewCountData.class

    Cewolf's running perfectly and i'm seeing the tutorial graph normally with PageViewCountData.class that i catch from cewolfexample-1.0.war.

    Now i'm changing the source code in JSP like this:

    My jsp file is:
    /opt/tomcat4/jakarta-tomcat-4.1.24/webapps/myapp/cewolf_arq/grafico.jsp

    ###############################################################

    <%@ page import = "java.sql.*, java.util.*,java.io.*,java.io.Serializable,java.lang.*,javax.*"%>
    <%@page import="org.jfree.data.*"%>

    <%String id_maquina = new String (request.getParameter("id_maquina"));%>
    <%String keep_alive = new String (request.getParameter("tipo_keep_alive"));%>
    <%String range = new String ( request.getParameter("range"));%>

    <%@ page contentType="text/html" %>
    <%@ taglib uri='../WEB-INF/cewolf.tld' prefix='cewolf' %>
    <HTML>
    <meta http-equiv="refresh" content="10">
    <BODY>
    <center><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Gr&aacute;ficos
      De Performance - <font color="#003399">Sistema S<font color="#009933">G</font>F</font></font></center>
    <center><font size="1"><b>Id Máquina:<%=id_maquina%> </b></font></center>
    <center><font size="1"><b>Keep Alive:<%=keep_alive%> </b></font></center>
    <center><font size="1"><b>Range:<%=range%> </b></font></center>
    <jsp:useBean id="pageViews" class="de.laures.cewolf.example.PageViewCountData"/>
    <cewolf:chart id="line" title="Performance do Sistema SGF" type="line"
    xaxislabel="Horario de Saida"
    yaxislabel="Tempo de Processamento(seg)">
    <cewolf:data>
    <cewolf:producer id="pageViews"/>
    <cewolf:param name="id_maquina" value='<%=(Serializable)id_maquina %>'/>
    <cewolf:param name="keep_alive" value='<%=(Serializable)keep_alive %>'/>
    <cewolf:param name="range" value='<%=(Serializable)range %>'/> 
    </cewolf:producer>
    </cewolf:data>
    </cewolf:chart>

    ################################

    and when i'm will look the graph (that was perfect like tutorial) i have now this error code:

    java.lang.ClassCastException
    at de.laures.cewolf.taglib.tags.ParamTag.doEndTag(ParamTag.java:40)
    at org.apache.jsp.grafico_jsp._jspService(grafico_jsp.java:168)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    ...

    ###########################################################################
    I already saw a lot of issues with a lot of alternatives on help forum but the problem persist.
    What i think that doesen't make sense is the fact that the tutorial graph is perfect and when i tried to pass parameters in jsp e have this error permanentely whatever the way that i pass it.

    i already tried some like this:

    <%String id_maquina = new String (request.getParameter("id_maquina"));%>
    <cewolf:param name="id_maquina" value='<%=(Serializable)id_maquina %>'/>

    and only:

    <cewolf:param name="id_maquina" value='<%=(Serializable) new String (request.getParameter("id_maquina"));'/>

    and
    <cewolf:param name="id_maquina" value='<%=(Serializable) request.getParameter("id_maquina");'/>

    PS: Already try " where i have ' like this:
    =(Serializable) request.getParameter("id_maquina");"/>

    And had the same error ever.
    Could you help me with this please....
    Best Regards
    Fabio Ram

     
    • Zoltan Luspai
      Zoltan Luspai
      2006-08-11

      Hi,

      The problem with the param tag, that it does not belong to the proper parent; which is the producer tag. Your producer tag is closed before the param tags, so the "/>" closing tag is the problem in this line:
      <cewolf:producer id="pageViews"/>

      Instead it should be:
      <cewolf:producer id="pageViews">
        ... params
      </cewolf:producer>

      btw; I am surprised that this has compiled at all...?
      Cheers,
      Zoltan

       
    • Fabio RAM
      Fabio RAM
      2006-08-11

      Thanks Zoltan,
      I was having a hard work to see what'as wrong with my code.
      In fact i didn't have the request of this parameters yet in my dataset producer...i'm using the default example PageViewCountData.class (from cewolfexample-1.0.war)to provide this tutorial graph.
      Everything works fine now.

      Tks For this help

      In sequence i create a new PageViewCountData.java to provide de request of this parameters that my jsp sends like this:

      machine:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/myapp/WEB-INF/classes/de/laures/cewolf/example# ll
      total 66
      -rw-r--r--   1 root       sys           1167 Aug 10 11:57 ConnectionFactory.class
      -rw-r--r--   1 root       sys           1662 Aug 10 11:56 ConnectionFactory.java
      -rw-r--r--   1 root       sys           1011 Aug  2 18:58 ExtraTitleEnhancer.class
      -rw-r--r--   1 root       sys           1062 Aug  2 18:58 HighLowDatasetProducer.class
      -rw-r--r--   1 root       sys           1151 Aug  2 18:58 PageViewCountData$1.class
      -rw-r--r--   1 root       sys           4013 Aug  2 18:58 PageViewCountData.class
      -rw-r--r--   1 root       sys           4013 Aug 10 11:58 PageViewCountData.class_bak
      -rw-r--r--   1 root       sys           6482 Aug 10 15:59 PageViewCountData.java
      -rw-r--r--   1 root       sys           5321 Aug  2 18:58 ParamBean.class
      -rw-r--r--   1 root       sys           2874 Aug  2 18:58 RandomXYData.class

      So based on the same structure that i described on last post i tried to compile a new PageViewCountData.java and i had this:

      machine:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/myapp/WEB-INF/classes/de/laures/cewolf/example#javac -deprecation PageViewCountData.java

      PageViewCountData.java:24: package org.jfree.data does not exist
      import org.jfree.data.CategoryDataset;
                            ^
      PageViewCountData.java:25: package org.jfree.data does not exist
      import org.jfree.data.DefaultCategoryDataset;
                            ^
      PageViewCountData.java:26: package de.laures.cewolf does not exist
      import de.laures.cewolf.DatasetProduceException;
                              ^
      PageViewCountData.java:27: package de.laures.cewolf does not exist
      import de.laures.cewolf.DatasetProducer;
                              ^
      PageViewCountData.java:28: package de.laures.cewolf does not exist
      import de.laures.cewolf.CategoryItemLinkGenerator;
                              ^
      PageViewCountData.java:29: package org.apache.commons.logging does not exist
      import org.apache.commons.logging.Log;
                                        ^
      PageViewCountData.java:30: package org.apache.commons.logging does not exist
      import org.apache.commons.logging.LogFactory;
                                        ^
      PageViewCountData.java:31: package org.jfree.chart.entity does not exist
      import org.jfree.chart.entity.CategoryItemEntity;
                                    ^
      PageViewCountData.java:32: package org.jfree.chart.tooltips does not exist
      import org.jfree.chart.tooltips.CategoryToolTipGenerator;
                                      ^
      PageViewCountData.java:50: cannot resolve symbol
      symbol  : class DatasetProducer
      location: class examples.PageViewCountData
      public class PageViewCountData implements DatasetProducer, CategoryToolTipGenerator, CategoryItemLinkGenerator, Serializable {
                                                ^
      PageViewCountData.java:50: cannot resolve symbol
      symbol  : class CategoryToolTipGenerator
      location: class examples.PageViewCountData
      public class PageViewCountData implements DatasetProducer, CategoryToolTipGenerator, CategoryItemLinkGenerator, Serializable {
                                                                 ^
      PageViewCountData.java:50: cannot resolve symbol
      symbol  : class CategoryItemLinkGenerator
      location: class examples.PageViewCountData
      public class PageViewCountData implements DatasetProducer, CategoryToolTipGenerator, CategoryItemLinkGenerator, Serializable {
                                                                                           ^
      PageViewCountData.java:55: cannot resolve symbol
      symbol  : class Logger
      location: class examples.PageViewCountData
          Logger log = Logger.getLogger(PageViewCountData.class);
          ^
      PageViewCountData.java:65: cannot resolve symbol
      symbol  : class DatasetProduceException
      location: class examples.PageViewCountData
          public Object produceDataset(Map params) throws DatasetProduceException {
                                                          ^

      They found no packages that i put on lib directory
      machine:/opt/tomcat4/jakarta-tomcat-4.1.24/webapps/myapp/WEB-INF/lib#

      Can u help me with this too?

      Thanks anyway Zoltan,
      Cheers
      Fabio Ram