Hi, I'd like to have a URL like this:
http://localhost:8080/myapp/ImageView/pict01.jpg so I make a page class as below, but when I use the above URL, Firefox will prompt user either to save or open the file instead of displaying directly the image, what is the proper way to do this? Thanks, A.C. public class ImageView { public StreamResponse onActivate(String jpegName) { String mapDir = System.getProperty("java.io.tmpdir"); String fileName = mapDir + "/" + jpegName; InputStream imageFileInputStream = null; try { imageFileInputStream = new FileInputStream(fileName); } catch (FileNotFoundException e) { e.printStackTrace(); } return createStreamResponse(imageFileInputStream); } private StreamResponse createStreamResponse(final InputStream is) { return new StreamResponse() { public String getContentType() { return "img/jpeg"; } public InputStream getStream() throws IOException { return is; } public void prepareResponse(Response response) { } }; } } -- View this message in context: http://www.nabble.com/T5%3A-display-jpeg-from-a-page-class-tp15546226p15546226.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]