AnsweredAssumed Answered

WebScript Response

Question asked by scoppola on Sep 27, 2010
Latest reply on Sep 27, 2010 by scoppola
Hi,
i'm trying to write a serialized java bean in webscript response, but I alway get an Internal Error message.
This is my piece of code :

                DettaglioFile df = (DettaglioFile) outParam.get("result");
               
                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                ObjectOutputStream oos = new ObjectOutputStream(baos);
                oos.writeObject(df);
                oos.close();
               
                Cache cache = new Cache();
                cache.setNeverCache(false);
                cache.setMustRevalidate(true);
                cache.setMaxAge(0L);
               
                //res.setHeader("Content-Length", Long.toString(baos.size()));
                //res.setContentType("application/octet-stream");
                //res.setCache(cache);
               
                res.getOutputStream().write(baos.toByteArray());

I'm sure there's something wrong, what could be ?

Outcomes