title: Create excel in Resteasy
body: <p>I would like to create/return an excel file from my RestEasy webservice but am having some trouble getting it to work. When i run the code below (pseudo code) I get the following error: </p>
  
  <blockquote>
    <p>org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not
    find MessageBodyWriter for response object of type:
    java.io.FileOutputStream of media type: application/vnd.ms-excel</p>
  </blockquote>
  
  <p>Here is some code</p>
  
  <pre><code>@POST
  @Path("/exportMyData")
  @Produces("application/vnd.ms-excel")
  public Response getMyData(@FormParam("id") String id) {
      HSSFWorkbook hwb = new HSSFWorkbook();
      ResponseBuilder response = null;
      try{
          List&lt;Alert&gt; alertList= service.getAlerts(id);
  
  
          HSSFSheet sheet =  hwb.createSheet("new sheet");
  
          HSSFRow rowhead=   sheet.createRow((short)0);
          rowhead.createCell((int) 0).setCellValue("ID");
          rowhead.createCell((int) 1).setCellValue("Name");
          rowhead.createCell((int) 2).setCellValue("Age");
  
  
          for(Alert alert : alertList){
              HSSFRow row=   sheet.createRow((short)1);
              row.createCell((int) 0).setCellValue(alert.getId());
              row.createCell((int) 1).setCellValue(alert.getName());
              row.createCell((int) 2).setCellValue(alert.getAge());
          }
  
  
          FileOutputStream fos = new FileOutputStream("mystream.xls");
          hwb.write(fos);
          response = Response.ok(fos);            
          response.header("Content-disposition","attachment; filename=export.xls");
      }catch(Exception e){
  
      }
  
      return response.build();
  }
  </code></pre>
  
  <p>Any ideas?
  Thanks in advance
  /Eric</p>