Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 29356 invoked from network); 1 Feb 2005 18:45:26 -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:45:26 -0000 Received: (qmail 48193 invoked by uid 500); 1 Feb 2005 18:45:12 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 48165 invoked by uid 500); 1 Feb 2005 18:45:12 -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 48145 invoked by uid 99); 1 Feb 2005 18:45:12 -0000 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=DNS_FROM_RFC_POST X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from smtp0.libero.it (HELO smtp0.libero.it) (193.70.192.33) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 01 Feb 2005 10:45:10 -0800 Received: from localhost (172.16.1.84) by smtp0.libero.it (7.0.027-DD01) id 41BDA86900A91142 for user@struts.apache.org; Tue, 1 Feb 2005 19:45:07 +0100 Received: from libero.it (172.16.1.111) by smtp1.libero.it (7.0.027-DD01) id 41BDB124005AD6BB for user@struts.apache.org; Tue, 1 Feb 2005 19:45:03 +0100 Date: Tue, 1 Feb 2005 19:45:06 +0100 Message-Id: Subject: Re: read local file in ActionStruts MIME-Version: 1.0 X-Sensitivity: 3 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable From: "gdilem\@libero\.it" To: "user" X-XaM3-API-Version: 4.1 (B27pl2) X-type: 0 X-SenderIP: 217.57.195.67 X-Virus-Scanned: by amavisd-new at libero.it serv5 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N it works just one time.If I open another browser it opens an empty RTF fi= le.My app produce correctly the RTF but your solution the second time doe= s not work! Cache problem?!?!? ---------- Initial Header ----------= - >From : fzlists@omnytex.com To : user@struts.apache.or= g Cc : Date : Tue, 1 Feb 2005 06:46:42 -0800 (PST) Subj= ect : Re: read local file in ActionStruts > I do something like this i= n one app... > > I'm creating PDFs on-the-fly and then displaying the= m 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 accord= ingly of course): > > > > Naturally, be sure your Action returns this forwar= d. > > (3) Add showPDF.jsp to your webapp. Here it is: > > <%@ p= age language=3D"java" import=3D"java.util.*" %> > <% > String url= =3D "http://"; > url +=3D request.getServerName(); > url +=3D = ":"; > url +=3D request.getServerPort(); > url +=3D "/myApp/tem= p/"; > url +=3D (String)request.getAttribute("userID"); > url += =3D ".pdf"; > %> > > > Show PDF</title= > > <meta http-equiv=3D"pragma" content=3D"no-cache"> > <meta h= ttp-equiv=3D"expires" content=3D"0"> > </head> > <body onLoad=3D"wi= ndow.location=3D'<%=3Durl%>';"> > Retrieving PDF for display... > = </body> > </html> > > That's it. Does the trick for me, nice and = simple. > > -- > Frank W. Zammetti > Founder and Chief Software Arc= hitect > Omnytex Technologies > http://www.omnytex.com > > On Tue, F= ebruary 1, 2005 9:12 am, gdilem\@libero\.it said: > > could u be more pr= ecise? > > U mean to save there the file and after that read it?! > > A= ctually I did not find any instructions. > > Do u? > > > > > > ----= ----- Initial Header ----------- > > > >>From : DGraham@Evergreen= Investments.com > > To : "Struts Users Mailing List" user@strut= s.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 > >> attri= bute? > >> > >> Dennis > >> > >> > >> Keshav Shetty <Keshav.Shetty@e= urodyn.com> > >> 02/01/2005 08:52 AM > >> Please respond to > >> "Stru= ts Users Mailing List" <user@struts.apache.org> > >> > >> > >> To > >= > Struts Users Mailing List <user@struts.apache.org> > >> cc > >> > >>= Subject > >> Re: read local file in ActionStruts > >> > >> > >> > >= > > >> > >> > >> Then don't store the file within webapp, but in any s= erver 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 sta= rtup. > >> >That's a big problem. > >> >Help! > >> > > >> >----------= Initial Header ----------- > >> > > >> >>From : "Keshav Shetty" K= eshav.Shetty@eurodyn.com > >> >To : "Struts Users Mailing List"= user@struts.apache.org > >> >Cc : > >> >Date : Tue, 01 F= eb 2005 15:36:06 +0200 > >> >Subject : Re: read local file in ActionStru= ts > >> > > >> > > >> > > >> >>You can store the file on sever and no= t in client. > >> >>If I understood you already created file in your str= uts 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 Pr= intWriter I try to get the file win a script tag > >> (<script>document.= location=3D'file:///xxx.xx'</script>) > >> >>>My problem is IE or Netsca= pe does not allow me to read local file. > >> >>>Any alternative idea?=0D = > >> >>> > >> >>> > >> >>> > >> > > >> > > >> > > >> >>> > >> >>>_= ___________________________________________________________ > >> >>>6X v= elocizzare la tua navigazione a 56k? 6X Web Accelerator di > >> Libero!=0D = > >> >>>Scaricalo su INTERNET GRATIS 6X http://www.libero.it > >> >>>=0D = > >> >>> > >> >>> > >> >>>---------------------------------------------= ------------------------ > >> >>>To unsubscribe, e-mail: user-unsubscrib= e@struts.apache.org > >> >>> > >> >>> > >> > > >> > > >> > > >> >>>= For additional commands, e-mail: user-help@struts.apache.org > >> >>>=0D = > >> >>> > >> >>> > >> >>> > >> >>> > >> >>> > >> >>----------------= ----------------------------------------------------- > >> >>To unsubscr= ibe, e-mail: user-unsubscribe@struts.apache.org > >> >>For additional co= mmands, e-mail: user-help@struts.apache.org > >> >> > >> >> > >> >>=0D = > >> >> > >> > > >> > > >> > > >> >__________________________________= __________________________ > >> >6X velocizzare la tua navigazione a 56k= ? 6X Web Accelerator di Libero! > >> >Scaricalo su INTERNET GRATIS 6X ht= tp://www.libero.it > >> > > >> > > >> > > >> >-----------------------= ---------------------------------------------- > >> >To unsubscribe, e-m= ail: user-unsubscribe@struts.apache.org > >> >For additional commands, e= -mail: user-help@struts.apache.org > >> > > >> > > >> > > >> > > >>=0D = > >> > >> --------------------------------------------------------------= ------- > >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org=0D = > >> For additional commands, e-mail: user-help@struts.apache.org > >>=0D = > >> > > > > > > > > _____________________________________________= _______________ > > 6X velocizzare la tua navigazione a 56k? 6X Web Acce= lerator di Libero! > > Scaricalo su INTERNET GRATIS 6X http://www.libero= .it > > > > > > > > ----------------------------------------------= ----------------------- > > To unsubscribe, e-mail: user-unsubscribe@str= uts.apache.org > > For additional commands, e-mail: user-help@struts.apa= che.org > > > > > > =0A=0A=0A=0A__________________________________= __________________________=0A6X velocizzare la tua navigazione a 56k? 6X = Web Accelerator di Libero!=0AScaricalo su INTERNET GRATIS 6X http://www.l= ibero.it=0A --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org