I am using Struts 1.1 on WebSphere 5.0 and quite often I get this error message. I heard this was a struts issue, because we don’t directly get the outputstream from a servlet, but thru the Action. Is this true? If so, does anyone know a workaround to this? I have noticed that the following is included in the output the user receives:
“Error 500: OutputStream already obtained”
Here is how I cause this in my action class:
OutputStream os = response.getOutputStream();
int k = 0;
String s;
for (int aa= 0; aa< items.size(); aa ++) {
k++;
s = (String)items.get(aa);
if (s != null) {
os.write(s.getBytes());
}
}
if (os != null ) {
os.close();
}