-
1. Re: trying to display a .doc file
jazir1979 Jan 6, 2008 11:23 PM (in response to mikeeprice)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 -
2. Re: trying to display a .doc file
mikeeprice Jan 9, 2008 9:10 AM (in response to mikeeprice)What I am wondering is why doesn't
mydoc
where mydoc.doc is an MSword file, work in my Seam application?
it says that mydoc.seam is not available. I don't understand Seam well enough to know why it is replacing .doc with .seam.
What I did to make this work is create a separate war file from my Seam application that had an html page with <a ref statements in it and Then I would link to that page from my Seam application pages. I think there is something I don't understand about Seam because I don't think I should have to do this.
I think I should be able to do <s:link view="mydoc.doc" value="mydoc"/> and a window with the MS Word file should pop up just like it normally does in a non Seam application. -
3. Re: trying to display a .doc file
mikeeprice Jan 9, 2008 9:13 AM (in response to mikeeprice)I forgot to disable html in previous post
mydoc should be mydoc -
4. Re: trying to display a .doc file
mikeeprice Jan 9, 2008 9:17 AM (in response to mikeeprice)Well I guess I don't undertstand how to display html in a post.
maybe "<"a href="mydoc.doc">mydoc" will make it work -
5. Re: trying to display a .doc file
pmuir Jan 9, 2008 10:18 AM (in response to mikeeprice)Use
<a href="mydoc.doc" /> not s:link