[jboss-user] [JBoss Seam] - Re: trying to display a .doc file

jazir1979 do-not-reply at jboss.com
Sun Jan 6 23:23:57 EST 2008

I serve files out of the DB using a custom FileServlet, with code similar to the following:

  | response.setHeader("Content-Disposition", "attachment; filename=" + file.getFilename());
  | response.setContentType(file.getContentType());
  | response.setContentLength(file.getData().length);
  | response.getOutputStream().write(file.getData());
  | response.flushBuffer();

It sounds like you want to load yours from the filesystem, but it should be similar.  The "Content-Disposition" header with value "attachment" makes it open the file in a new window.

"mikeeprice" wrote : Trying to display a an MS Word .doc file with
  | <s:link view="/CamdenPlanVSN-1.2-1-2-08.doc" styleClass="footerLink">
  |       <h:outputText value="Camden Emergency Plan"/>
  | </s:link>
  | but get
  | description The requested resource (/cwe/CamdenPlanVSN-1.2-1-2-08.seam) is not available.
  | I can not find documentation telling how to display .doc files and other file types under Seam. For some reason it changes .doc to .seam on the file name.
  | I would also like to bring it up in a new window such as target="_blank".
  | Any suggestions, Thanks

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117433#4117433

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117433

More information about the jboss-user mailing list