Although its not a struts problem as such I do happen to be using struts in my app..


Here some code as it will say more in less words that it will take to explain

In my action servlet I have something like this..

<code>
response.setContentType("image/jpeg");
response.setHeader("Cache-Control", "no-cache");
OutputStream ou = response.getOutputStream();

String imageStr = "file:///foo/test.jpg";
java.net.URI imgUri = new java.net.URI(imageStr);
File imageFile = new File(imgUri);
FileInputStream imageFileStream = new FileInputStream(imageFile);
byte[] image = new byte[(int) imageFile.length()];System.out.println("imageFile.length()::::"+ imageFile.length());
ou.write(image);


</code>

Now the system out returns the correct amount of bytes so its seeing the image and not getting file not found exception. but it just wont stream back to my jsp when i run the action.

This code is basically a else clause when no results are returned from the database.. The results from the db (via hibernate works just fine) but this bit doesn't..

Can anyone who's done this cast their eye over it for anything obviously wrong. Could it be a permissions issue?

Cheers Mark


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to