Hi Tony
Thanks for the response , here is what I am doing,
1) I have an Applet which takes user input as text.
2) From applet it passes simple parameters to the servlet using the
showDocument method showDocument("http://server/webapp/ServletName?text1=text1&text2=text....")
3) The servlet gets the parameters and constructs images out of those
text using customer defined fonts (from Font.createFont() methods)
4)Using PixelGrabber the image is serialized as int[] to the response
stream
Now....
A) After serialization I want to reload the applet so that it
de-serializes the int[] and reconstruct the image (The reconstruction
of image and displaying it on applet is working fine , when i run the
servlet as a standalone (with no user input)), but when I take the
user input ...here is what the problem comes
Regards
Ray
"Tony Morris" <> wrote in message news:<c11ef7$kq0$>...
> "Kim Ray" <> wrote in message
> news: m...
> > Hi All,
> > I am faceing a problem (ofcourse thats what makes all of us come
> > here)..what I am trying to do is , create a image offscreen in a
> > servlet , then using PixelGrabber serialize the int[] and then the
> > applet reads it, ..so far fairly straight, now here...
> > ...
> > ...
> > ObjectOutputStream out = new
> > ObjectOutputStream(res.getOutputStream());
> > System.out.println("Inside isReq after out obj");
> > out.writeInt(w);
> > out.writeInt(h);
> > out.writeObject(pixels);
> > }
> > /**
> > try{
> > res.setContentType("text/html");
> > printer=res.getWriter();
> > printer.println("Object Writing done");
> > printer.close();
> > }catch(Exception ex){}
> > }
> > else{
> > printer.println("Object Writing <b>Not</b> done");
> > printer.close();
> > }**/
> >
> > After Object writing is being done , I wish to display a html page
> > (with applet embedded) but using the above code it is giving me a
> > error "IllegalStateException: Writer being already used by the
> > servlet..."
> > Can anyone help me out...
> >
> > Regards
> > Ray
>
> Read the API documentation
> You can't call HttpServletResponse#getWriter() after a call to
> HttpServletResponse#getOutputStream()
> and there's a good reason for that (more in-depth thought required on your
> part).
>
> It is very unclear what you are trying to achieve, so I can't offer a
> correct solution.
>
> PS:
> catch(java.lang.Exception e) // this piece of code *should* result in
> castration (unless the Exception is rethrown) - it's poor form