Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

No Result defined for action in struts2.samples.actions.ReportsAction and result success  RSS feed

KRamesh mca
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In my Struts2 project I had an error
"No result defined for action struts2.samples.actions.ReportsAction and result success"

when I tried to use jasperreports plugin with result type="jasper" and the struts.xml action mapping is as follows,

"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"

<!-- Author: SCO03_2 -->

<!-- Add your configuration elements here -->
<package name="default" extends="struts-default,jasperreports-default">
<default-interceptor-ref name="defaultStack"/>
<action name="persons" class="struts2.samples.actions.PersonAction">
<result name="input">index.jsp</result>
<result type="chain">reports</result>
<action name="reports" class="struts2.samples.actions.ReportsAction">
<interceptor-ref name="params"/>
<interceptor-ref name="validation"/>
<interceptor-ref name="workflow"/>
<result name="success" type="jasper">
<param name="location">${reportLocation}</param>
<param name="dataSource">${persons}</param>
<param name="format">pdf</param>
<result name="input">index.jsp</result>
</struts> (a required part)

public String execute() throws Exception {
try {
PersonsDao personsDao=new PersonsDao();
//calling helper class method to create a Person record on the data store
personsDao.create(firstname, lastname, age,sex,address,document,documentFileName);
return "success";
} catch (Exception ex) {
return "input";

public String execute(){
PersonsDao personDao=new PersonsDao();
setReportLocation(new PersonsReport().createReport(request,"reports/Persons.jrxml","reports/Persons.jasper"));
return "success";
}catch(Exception ex){
return "input";


In Actions,( and functionality was perfect except the result view as jasper.File was properly uploaded in the desired location. I need the solution for this. I require your help.

Best Regards,
Ramesh K

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!