|
From: Chris H. <chr...@aw...> - 2006-02-02 16:41:19
|
Hi, I've just started using JasperReports in Spring, and came across a problem which I would like to suggest a fix. I would like to chain the JasperReportsViewResolver(JRVR) before my main JSP resolver. I would expect the JRVR to pass control to the JSP resolver if it cannot find the requested .jasper file, but it actually throws an exception. This means that the JRVR in its current form cannot be used in a Resolver Chain. To make it Resolver Chain friendly, it must return a null view on fail. I have made the assumption that if the file doesnt exist, this is a failure. I have made some minor modifications as follows: 1. Added JRVR.createView(String, Locale) to overload its abstract parent. This calls loadView() but catches the exception thrown in AbstractJaspperReportsView.loadReport(Resource), which returns null. 2. In AbstractJaspperReportsView.loadReport(Resource), I changed the exception thrown for the caught IOException as I needed to differentiate between the two catch statements. Hope this is of use to someone in the future. Regards, Chris |