What we did was create an action that takes parameters of the xml and XSLFO
documents and merges them then outputs that to the browser window.  To make
this happen we mapped a certain directory in web.xml to the struts action
<servlet-mapping>

<servlet-name>action</servlet-name>

<url-pattern>/pdf/convert/*</url-pattern>

</servlet-mapping>

then in the struts config it looks like this:

<action path="**.pdf" type="salesweb.control.struts.ConvertAction"
parameter="{1}">

<set-property property="secure" value="false"/>

</action>

What this does is takes anything like /pdf/convert/test.pdf or
/pdf/convert/workyplease.pdf and forwards that to the action.  This is using
the struts wildcards plugin, http://www.twdata.org/struts-wildcard/.

So a link to run our action would look like
http://www.myserver.com/myservletcontext/pdf/convert/audio.pdf?source=audio.xml&style=transform.xsl

Works perfect in IE6 with the latest adobe reader.

If you need anymore info shoot me an email.

-David

----- Original Message ----- 

From: "Mahbub ul Huq Bin Kabir" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 29, 2003 5:34 AM
Subject: how to show pdf from the struts


> Hi,
>
> I'm using struts from few months and now doing reports using xml and xslt.
> I'm using xalan to generate reports and now want to use FOP to generate
> reports. I make a report and i can generate it but I'm using Internet
> Explorer 6.0 which does not starts Acrobat reader automatically, i go
> through the fop's web site and they suggeste to fake it using .pdf
> extension. Can anyone help me to get out of this problem.
>
> I want to add a extra parameter with my action submit like this
> http://localhost/meena/report.ezb?fakeID=usethis.pdf
>
> or any better idea and solution
>
> Thank you,
>
> Mahbub
>
> _________________________________________________________________
> MSN 8 with e-mail virus protection service: 2 months FREE*
> http://join.msn.com/?page=features/virus
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to