IllegalStateException...Writer being already used by this servlet

From: Kim Ray (simplyinluv_at_yahoo.com)
Date: 02/18/04

  • Next message: tarun: "jdk 1.4 StackoverFlowError"
    Date: 18 Feb 2004 04:20:49 -0800
    
    

    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


  • Next message: tarun: "jdk 1.4 StackoverFlowError"

    Relevant Pages