struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Singh, Sandeep" <SSI...@kheaa.com>
Subject PDF Question
Date Thu, 09 May 2002 16:22:24 GMT
I am accessing Pdf from servlet and passing the Values to 
Fields of PDf it working good.Only thing is it is opening PDF
Seprately and I want it to be inside the browser.Below is the Code:

FDFDoc fdfdoc = new FDFDoc();
//Populate FDF doc
new DspPDF().execute(fdfdoc,bbean,bsbean,refbean,lnbean,payopt);
//End Populate
if (apptype.equalsIgnoreCase("AGI")){
fdfdoc.SetFile("C:"+s+ "Program Files"+s+"IBM"+s+"VisualAge for
Java"+s+"ide"+s+"project_resources"+s+"IBM 		WebSphere Test
Environment"+s+"hosts"+s+"default_host"+s+"Conso"+s+"web"+s+"AGIconsol.pdf")
;
}else if(apptype.equalsIgnoreCase("KHESLC")){
fdfdoc.SetFile("C:"+s+ "Program Files"+s+"IBM"+s+"VisualAge for
Java"+s+"ide"+s+"project_resources"+s+"IBM 	WebSphere Test
Environment"+s+"hosts"+s+"default_host"+s+"Conso"+s+"web"+s+"slpconsol.pdf")
;
  					}

response.setContentType("application/vnd.fdf");
OutputStream out = response.getOutputStream();
fdfdoc.Save(out);
out.close();

Sandeep





-----Original Message-----
From: Nekkalapudi, Viplava [mailto:VNekkalapudi@erac.com]
Sent: Thursday, May 09, 2002 10:19 AM
To: 'Struts Users Mailing List'
Subject: RE: some PDF stuff


Its working great.

But I have some related issues:
1.  response.setHeader("Content-disposition","attachment;
filename="+filename);
    Because of this it is opening a File Download dialog window 
    three (3) times: first one represents the src page action path, 
    second one is the generate report action class and 
    third one is the pdf filename.
    This is little bit annoying.

2.  Once we open a PDF in a separate window, Is it possible to clear
    the error messages on the src JSP? (</html:errors>).
    For Example: If I don't select a required filed, 
    an error will be displayed. Then select the required field, 
    click "generate report" opens up a new PDF window, Still we can see 
    the errors on the JSP. Even I close the PDF window I see errors on the
JSP.
     
    

Thanks,
Vip.


-----Original Message-----
From: Vincent Aumont [mailto:vincent.aumont@vsl.ca]
Sent: Tuesday, April 30, 2002 7:45 PM
To: Struts Users Mailing List
Subject: Re: some PDF stuff




> >  response.setHeader("Content-disposition","attachment; filename=" +
> filename);
>
>  I don't have a file name for the pdf I generate (may be I can have one).

Any name will do. It's the name the browser uses should your user decide to
save
the document to disk.

>  The Action class returns a NULL Action Forward.

Same here.

-Vincent.


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message