Can any one help me in telling the ways to serialize an
applet after creating & painting(drawing graph) the applet. The applet will be passed with parameters with which it has to draw a graph and need to send it as a response.
I am trying to pass some parameter from an HTML which will call a
servlet, which needs to send an applet that should be the bar graph of the parameters that i have sent.
(ie) i need to call a servlet xyz with parameter lets say a1=10,a2=20,a3=30..... like
http://127.0.0.1:8080/examples/servlet/graph?a1=10&a2=20&a3=3.... I have the following methods in the applet
class xyzApplet extends Applet {
int parms[];
public void setParameter(int a[]){
parms = a;
}
public void DrawGraph() {
//take the values of parms[] and draw graph
}
}
I am doing the following piece of code in the doGet of servlet
{
int d[];
d[0] = req.getParameter("Graph1");
.
......
xyzApplet x= new xyzApplet();
x.setParameter(d);
x.paint(x.getGraphics());
...
}
How do I serialize the painted applet from the servlet. Can any one help me? If you could not understand the question please let me know.
Thanks a bunch
Chandar