Doh, I must have replied to a topic, my bad.

>>What is "my-webapp"? A directory? Your web app's context? If the latter, 
>>that certainly won't work, you'd need to get the path relative to your 
>>webapp's deployment.

Yes, it's the context directory, I've also just tried it with
/jasper/scrounger_report.jasper.

> I have put a file here:
> 
> /jasper/report.jrxml

>>Without any context I have no idea where that file is: is it on the 
>>classpath? Is it in the webapp root?

The webapp root, that is, if I do a listing of my war file, it's in the root
of it, at /jasper/scrounger_report.jasper

>>If compileReportToFile is expecting a physical file you may have issues 
>>if you're deploying a war file, since files contained in it may not be 
>>accessible in this manner.

I've looked in my webapps directory, the war gets expanded and the file
exists on the filesystem.  Are you saying I may still have issues?

>>Are you actually compiling the report each time the action is hit?

No, I'm just testing to make sure I can figure this out.


-----Original Message-----
From: Dave Newton [mailto:newton.d...@yahoo.com] 
Sent: Tuesday, April 21, 2009 4:37 PM
To: Struts Users Mailing List
Subject: Re: Jasper Plugin cannot find file

Please start new threads for new topics.

Security Management wrote:
> I have put a file here:
> 
> /jasper/report.jrxml

Without any context I have no idea where that file is: is it on the 
classpath? Is it in the webapp root?

> <action name="saveReport" class="com.secmgmt.struts2.actions.SaveReport">
>               <result name="success" type="jasper">
>             <param name="location">/jasper/scrounger_report.jasper</param>
>             <param name="dataSource">personList</param>
>             <param name="format">PDF</param>
>         </result>
> </action>
> 
> I've also tried:
> <param name="location">my-webapp/jasper/scrounger_report.jasper</param>
> 
> Which is what the tutorial has.
> 
> In my action, I have:
> try
>             {
>                 JasperCompileManager.compileReportToFile(
>                     "my-webapp/jasper/scrounger_report.jrxml",
>                     "my-webapp/jasper/scrounger_report.jasper");

What is "my-webapp"? A directory? Your web app's context? If the latter, 
that certainly won't work, you'd need to get the path relative to your 
webapp's deployment.

If compileReportToFile is expecting a physical file you may have issues 
if you're deploying a war file, since files contained in it may not be 
accessible in this manner.

Are you actually compiling the report each time the action is hit?

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to