Jump to content
We've recently updated our Privacy Statement, available here ×

Struts2 Jasper and Annotations


quentinb

Recommended Posts

Hi All.

I need help using Jasper Reports with Struts2 annotations.
I keep getting this error:

Please Help!!

Unable to load configuration. - [unknown location]

Caused by: The Result type [jasper] which is defined in the Result annotation on the class [class za.co.credicor.crud.regions.action.RegionsReport] or determined by the file extension or is the default result type for the PackageConfig of the action, could not be found as a result-type defined for the Struts/XWork package [za.co.credicor.crud.regions.action#convention-default#] - [unknown location]

 

Code:
Inside My Class:@Results({	@Result(name="success", type="jasper", params={"location","/pages/jasper/our_compiled_template.jasper","format","PDF"})	})        try {            JasperCompileManager.compileReportToFile(                    "/pages/jasper/our_jasper_template.jrxml",                    "/pages/jasper/our_compiled_template.jasper");        } catch (Exception e) {            e.printStackTrace();            return ERROR;        }Inside struts.xml	<package name="default" extends="struts-default">		<result-types> 			<result-type name="jasper" class="org.apache.struts2.views.jasperreports.JasperReportsResult" /> 		</result-types>	</package>
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...