0 Replies Latest reply on Feb 23, 2009 9:44 AM by Benito Juarez

    Error while accessing servlet response

    Benito Juarez Newbie

      Hi,

      i tried to access the servlet response to directly write binary data:

      HttpServletResponse response = (HttpServletResponse) javax.faces.context.FacesContext.getCurrentInstance().getExternalContext().getResponse();
      
      response.setContentType("application/octet-stream");
      response.addHeader("Content-Disposition","attachment;filename=productlist.xls");
      
      OutputStream writer = response.getOutputStream();
      wb.write(writer);
      
      writer.flush();
      writer.close();
      
      javax.faces.context.FacesContext.getCurrentInstance().responseComplete();
      


      but response.getOutputStream() throws an exception:
      15:30:11,190 ERROR [STDERR] java.util.MissingResourceException: Can't find bundle for base name org.ajax4jsf.messages, locale de_DE
      15:30:11,190 ERROR [STDERR] at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1521)
      15:30:11,190 ERROR [STDERR] at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1260)
      15:30:11,190 ERROR [STDERR] at java.util.ResourceBundle.getBundle(ResourceBundle.java:962)
      15:30:11,190 ERROR [STDERR] at org.ajax4jsf.Messages.getBundle(Messages.java:39)
      15:30:11,190 ERROR [STDERR] at org.ajax4jsf.Messages.getMessage(Messages.java:47)
      15:30:11,190 ERROR [STDERR] at org.ajax4jsf.webapp.FilterServletResponseWrapper.getOutputStream(FilterServletResponseWrapper.java:252)
      15:30:11,190 ERROR [STDERR] at javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:102
      


      i'm happy for any hint about that

      Thx
      BJ