Thanks for catching that. It didn't fix the problem.
From: Kevin Tarn Sent: Saturday, December 20, 2008 5:31 AM To: [email protected] Subject: Re: images don't show in IE It might be not related though. But why do you call sos.flush after sos.close? Kevin On Sat, Dec 20, 2008 at 6:41 AM, L Frohman <[email protected]> wrote: Thanks, my servlet: public class ThumbnailServlet extends HttpServlet { private static Log s_logger = LogFactory.getLog(ThumbnailServlet.class); private static final long serialVersionUID = 1L; public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("image/JPEG"); ServletOutputStream sos = response.getOutputStream(); BasicDataSource basicDataSource = (BasicDataSource)WebApplicationContextUtils.getWebApplicationContext(getServletContext()).getBean("dataSource"); try { Class.forName(basicDataSource.getDriverClassName()); Connection conn = DriverManager.getConnection(basicDataSource.getUrl(), basicDataSource.getUsername(), basicDataSource.getPassword()); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("select thumbnail from construct_data where id_construct = " + request.getParameter("id")); if ( rs.next() ) { byte[] b = rs.getBytes(1); if (b!=null) { sos.write(b); } } stmt.close(); rs.close(); conn.close(); } catch (Exception e) { s_logger.error("Failed request for thumbnail for ID: \"" + request.getParameter("id") + "\"", e); } sos.close(); sos.flush(); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ... } } -------------------------------------------------- From: <[email protected]> Sent: Friday, December 19, 2008 1:56 PM To: "Google Web Toolkit" <[email protected]> Subject: Re: images don't show in IE > > Are you doing some thing like response.setContentType("image/jpeg") in > your servlet. > > Perhaps posting some of you servlet might help. > > On Dec 19, 2:58 pm, "L Frohman" <[email protected]> wrote: >> My GWT page displays a bunch of .jpg images, and they display fine in all >> browsers, except for IE. The URL for the jpg image is a >> servlet that generates the jpg, so there is no ".jpg" extension. In IE, >> no images show, either in web or hosted mode. In hosted mode, >> I set a breakpoint on an onclick for a button, so I could click it and >> look at the page .html in the debugger. None >> of the __pendingSrc= in the img tag had changed to src=. Does anyone know >> what would cause this? > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
