the param tag in cewolf's JSP tag library

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Juanma

the param tag in cewolf's JSP tag library

Post by Juanma » Thu Aug 08, 2002 7:40 am

The value of the tag param is supossed to be a java.io.Serializable object but although I use a String it doesn´t work. Can emplain me why?

thanks in advance.

The code:

<%@page contentType="text/html"%>
<%@page import="java.util.*"%>
<%@page import="java.util.Date"%>
<%@page import="java.sql.*"%>
<%@page import="java.io.Serializable"%>
<%@page import="de.laures.cewolf.*"%>
<%@page import="com.jrefinery.data.*"%>
<%@taglib uri='/WEB-INF/cewolf.tld' prefix='cewolf' %>

<%
java.io.Serializable valor1 = new String("10");
pageContext.setAttribute("valor1",valor1);
java.io.Serializable valor2 = new String("2");
pageContext.setAttribute("valor2",valor2);

DatasetProducer pieData1 = new DatasetProducer() {
public Object produceDataset(HashMap params) {
DefaultPieDataset ds = new DefaultPieDataset();
ds.setValue("Hombres", new Integer((String)params.get("A")));
ds.setValue("Mujeres", new Integer((String)params.get("B")));
return ds;
}
}; //Fin del constructor
pageContext.setAttribute("pieData1", pieData1);

%>
<html>
<body>
<cewolf:chart id="pie3d" title="Población activa" renderer="servlet/chart" width="300" height="300" type="pie3D">
<cewolf:data>
<cewolf:producer id="pieData1">
<cewolf:param name="A" value="valor1" />
<cewolf:param name="B" value="valor2" />
</cewolf:producer>
</cewolf:data>
</cewolf:chart>
</body>
</html>



The error:

org.apache.jasper.JasperException: Unable to convert string 'valor1' to class java.io.Serializable for attribute value: java.lang.IllegalArgumentException: Property Editor not registered with the PropertyEditorManager

David Gilbert

Re: the param tag in cewolf's JSP tag library

Post by David Gilbert » Thu Aug 08, 2002 9:03 am

I don't mind Cewolf related discussion in this forum, but:

1) I won't be able to help out much with answers since I don't know a lot about JSP;

2) it probably makes sense to ask the questions in the Cewolf discussion forum, since that is where many JSP developers will probably look first.

The Cewolf project page is:

http://cewolf.sourceforge.net/

I've said it elsewhere, but I'll say it again: a BIG thanks to Guido for his work making JFreeChart more accessible to JSP developers...

Regards,

DG.

Guido Laures

Re: the param tag in cewolf's JSP tag library

Post by Guido Laures » Fri Aug 09, 2002 7:07 pm

You are welcome David.
But as I said before: Nor Cewolf without JFreeChart. Cewolf is just a littel add on to enable easy web usage.

BTW: Juanma's problem has been solved at Cewolf's discussion forum.
I am sorry for people "polluting" your forum with cewolf related questions.

Regards,
Guido

Locked