cancel
Showing results for 
Search instead for 
Did you mean: 

WebScript Response

scoppola
Champ in-the-making
Champ in-the-making
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 ?
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
Is there some more information in the "Internal Error" or possibly a stack trace?

scoppola
Champ in-the-making
Champ in-the-making
Ok i resolve the problem.
The issue was I call more than once the writer and I get an Internal Error.