Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 32786 invoked from network); 1 Feb 2005 18:54:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Feb 2005 18:54:15 -0000 Received: (qmail 63028 invoked by uid 500); 1 Feb 2005 18:53:57 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 63007 invoked by uid 500); 1 Feb 2005 18:53:57 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 62992 invoked by uid 99); 1 Feb 2005 18:53:57 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from chiron.lunarpages.com (HELO chiron.lunarpages.com) (64.235.234.14) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 01 Feb 2005 10:53:55 -0800 Received: from chiron.lunarpages.com ([64.235.234.14]) by chiron.lunarpages.com with esmtpa (Exim 4.44) id 1Cw39t-00068R-4U for user@struts.apache.org; Tue, 01 Feb 2005 10:53:53 -0800 Message-ID: <19680343.1107284033001.JavaMail.root@chiron.lunarpages.com> Date: Tue, 1 Feb 2005 10:53:52 -0800 (PST) From: fzlists@omnytex.com To: user@struts.apache.org Subject: Re: read local file in ActionStruts Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_9_18484533.1107284032913" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - chiron.lunarpages.com X-AntiAbuse: Original Domain - struts.apache.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - omnytex.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------=_Part_9_18484533.1107284032913 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hmm... Could be a cache issue, although that seems kind of unlikely. Try removing the two cache lines in showPDF.jsp and see what happens. Is there any chance the file isn't being close after being written, or something along those lines? I would also use something like HTTPWatch and see what's actually going over the wire to and from the serve, check the headers, all that jazz. If I had to place a bet, I'd say it's something odd the browser is doing, that's the case more times than not with things like this. I know for sure I can view any number of PDFs using this approach, and while I can't rule it out I wouldn't expect an RTF file to present any problem. Unlee... does the Word pluging come up to view it? If so, that's one more potential problem area (plugins... bleh!) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Tue, February 1, 2005 1:45 pm, gdilem\@libero\.it said: > it works just one time.If I open another browser it opens an empty RTF > file.My app produce correctly the RTF but your solution the second time > does not work! > Cache problem?!?!? > > > ---------- Initial Header ----------- > >>>From : fzlists@omnytex.com > To : user@struts.apache.org > Cc : > Date : Tue, 1 Feb 2005 06:46:42 -0800 (PST) > Subject : Re: read local file in ActionStruts > >> I do something like this in one app... >> >> I'm creating PDFs on-the-fly and then displaying them on the browser. I >> have a directory named temp under my webapp that the PDFs get written >> to. The files are named according the the user ID. >> >> You have the Action writing out the file already... if we assume you >> also name it according to user ID, here's how to do it... >> >> (1) Make sure your Action adds the user ID to request as an attribute >> >> (2) Add the following forward to your ActionMapping (changing the path >> accordingly of course): >> >> >> >> Naturally, be sure your Action returns this forward. >> >> (3) Add showPDF.jsp to your webapp. Here it is: >> >> <%@ page language="java" import="java.util.*" %> >> <% >> String url = "http://"; >> url += request.getServerName(); >> url += ":"; >> url += request.getServerPort(); >> url += "/myApp/temp/"; >> url += (String)request.getAttribute("userID"); >> url += ".pdf"; >> %> >> >> >> Show PDF >> >> >> >> >> Retrieving PDF for display... >> >> >> >> That's it. Does the trick for me, nice and simple. >> >> -- >> Frank W. Zammetti >> Founder and Chief Software Architect >> Omnytex Technologies >> http://www.omnytex.com >> >> On Tue, February 1, 2005 9:12 am, gdilem\@libero\.it said: >> > could u be more precise? >> > U mean to save there the file and after that read it?! >> > Actually I did not find any instructions. >> > Do u? >> > >> > >> > --------- Initial Header ----------- >> > >> >>From : DGraham@EvergreenInvestments.com >> > To : "Struts Users Mailing List" user@struts.apache.org >> > Cc : >> > Date : Tue, 1 Feb 2005 09:06:51 -0500 >> > Subject : Re: read local file in ActionStruts >> > >> >> How about using the javax.servlet.context.tempdir Servletcontext >> >> attribute? >> >> >> >> Dennis >> >> >> >> >> >> Keshav Shetty >> >> 02/01/2005 08:52 AM >> >> Please respond to >> >> "Struts Users Mailing List" >> >> >> >> >> >> To >> >> Struts Users Mailing List >> >> cc >> >> >> >> Subject >> >> Re: read local file in ActionStruts >> >> >> >> >> >> >> >> >> >> >> >> >> >> Then don't store the file within webapp, but in any server folder and >> >> write a servlet to retrieve the file. >> >> >> >> Thanks & regards >> >> Keshav K Shetty >> >> >> >> gdilem@libero.it wrote: >> >> >> >> >Tomcat see a new created file only after shutdown and startup. >> >> >That's a big problem. >> >> >Help! >> >> > >> >> >---------- Initial Header ----------- >> >> > >> >> >>From : "Keshav Shetty" Keshav.Shetty@eurodyn.com >> >> >To : "Struts Users Mailing List" user@struts.apache.org >> >> >Cc : >> >> >Date : Tue, 01 Feb 2005 15:36:06 +0200 >> >> >Subject : Re: read local file in ActionStruts >> >> > >> >> > >> >> > >> >> >>You can store the file on sever and not in client. >> >> >>If I understood you already created file in your struts action and >> >> >>stored in the server. >> >> >>So instead of giving file:// use full link with http:// link to >> file. >> >> >>(Hope the file is within webapp) or write your download servlet. >> >> >> >> >> >>Thanks & regards >> >> >>Keshav >> >> >> >> >> >>gdilem@libero.it wrote: >> >> >> >> >> >> >> >> >> >> >> > >> >> > >> >> > >> >> >>>Hi all >> >> >>>In an Action Struts I create dynamically a file. >> >> >>>After that whit PrintWriter I try to get the file win a script tag >> >> () >> >> >>>My problem is IE or Netscape does not allow me to read local file. >> >> >>>Any alternative idea? >> >> >>> >> >> >>> >> >> >>> >> >> > >> >> > >> >> > >> >> >>> >> >> >>>____________________________________________________________ >> >> >>>6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di >> >> Libero! >> >> >>>Scaricalo su INTERNET GRATIS 6X http://www.libero.it >> >> >>> >> >> >>> >> >> >>> >> >> >>>--------------------------------------------------------------------- >> >> >>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >> >> >>> >> >> >>> >> >> > >> >> > >> >> > >> >> >>>For additional commands, e-mail: user-help@struts.apache.org >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>--------------------------------------------------------------------- >> >> >>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >> >> >>For additional commands, e-mail: user-help@struts.apache.org >> >> >> >> >> >> >> >> >> >> >> >> >> >> > >> >> > >> >> > >> >> >____________________________________________________________ >> >> >6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di >> Libero! >> >> >Scaricalo su INTERNET GRATIS 6X http://www.libero.it >> >> > >> >> > >> >> > >> >> >--------------------------------------------------------------------- >> >> >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >> >> >For additional commands, e-mail: user-help@struts.apache.org >> >> > >> >> > >> >> > >> >> > >> >> >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >> >> For additional commands, e-mail: user-help@struts.apache.org >> >> >> >> >> > >> > >> > >> > ____________________________________________________________ >> > 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! >> > Scaricalo su INTERNET GRATIS 6X http://www.libero.it >> > >> > >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org >> > For additional commands, e-mail: user-help@struts.apache.org >> > >> > >> >> > > > > ____________________________________________________________ > 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! > Scaricalo su INTERNET GRATIS 6X http://www.libero.it > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > > ------=_Part_9_18484533.1107284032913 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org ------=_Part_9_18484533.1107284032913--