struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Trouble getting .pdf into the URL
Date Mon, 01 Jul 2002 14:57:18 GMT

I'm trying to get a parameter (dummy=.pdf) into my URL in order for IE to
realize that it should display the pdf with Acrobat.  Unfortunately, I'm
hitting dead-ends.  I'm running the action which generates the pdf via a
form submit in order to handle some input fields for the search criteria of
the report.  I have a simple report where there are no input paramters and I
was able to use a <html:link> successfully to display the report using
<html:link page="/do/varianceTotal?dummy=.pdf">.  This works perfectly
everytime.  So, when I set up the action I tried adding the parameter to the
action attribute like: <html:form method="POST"
action="/runVarianceReport?dummy=.pdf" focus="transactionRegion"> but this
caused an error because it couldn't find the action servlet (I'm assuming
because "/runVarianceReport?dummy=.pdf"  != "/runVarianceReport").  So, I
tried changing the struts-config.xml to match, but then I got the error:
java.lang.StringIndexOutOfBoundsException: String index out of range: 25.

Next, I got the bright idea that I could create a second action and forward
to that action using a redirect and include the parameter in the URL.  Seems
like this idea would work, but for a reason which I haven't figured out,
absolutely nothing happens at the end of my first action (as if I'm
returning null).  My struts-config.xml for this looks like:

    <!-- Run variance report program -->
    <action path="/runVarianceReport" 
      <forward name="showpdf" path="/do/displayPDF?dummy=.pdf"
redirect="true" />

    <!-- Generate the PDF -->
    <action path="/displayPDF"

and in my java code, I do: return (mapping.findForward("showpdf"));

Thank you in advance for any help,

Mike Witt

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message