Cy-Anass / grails-jasper-response-plugin

Automatically exported from code.google.com/p/grails-jasper-response-plugin
0 stars 0 forks source link

File not Found because of missing slash after WEBAPPROOTPATH on Production System only #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. grails war
2. deploy to jetty (8)
3. render params as Jasper, no params or settings

When i use Grails 2.2.3 running on macos for development (with intellij) 
everything is working.

If i deploy to the Production Server, Ubuntu, grails 2.2.3,  Jetty 8 the Report 
cannot be rendered.

I changed the render Method in 
grails.plugin.jyoshirio.jasperResponse.renderers.Jasper, Line 87 to
 String checkedWebRootPath =  (WEBAPPROOTPATH.endsWith("/") ? WEBAPPROOTPATH : WEBAPPROOTPATH+"/")
 String path = "${checkedWebRootPath}${relativePath}"
 String reportname = "${path}${jasperFile}.jasper"
 params.SUBREPORT_DIR= "$path"

 def jasperResponseStream = net.sf.jasperreports.engine.JasperRunManager."runReportTo${renderType.capitalize()}"(reportname,params,connection);

the path is checked for a trailing slash, moreover the subreport directory is 
set which makes including of images and subreports easier.

Working in development and Production after that changes.

Original issue reported on code.google.com by lan...@ramsch.com on 9 Jul 2013 at 8:39