File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

org.apache.struts2.dispatcher.Dispatcher serviceAction Could not find action or result

 
Neeraj Vij
Ranch Hand
Posts: 315
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am getting the following exception in my code. Please provide some pointers for solving the issue.

org.apache.struts2.dispatcher.Dispatcher serviceAction Could not find action or result

struts.xml is as follows-



1.) first "kanjiexternaluserprofile" action is called and the page is loaded correctly.
2.) there is form on jsp/ja_JP/externalUserProfile.jsp which submits the form to "kanjiexternalUserProfileSuccess" action
3.) after submitting the form I am getting the exception


Thanks,
Neeraj.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where's the rest of the stack trace? Where's the JSP fragment that produces the exception on submit?
 
Neeraj Vij
Ranch Hand
Posts: 315
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for a prompt reply

following is the jsp fragment


and

following is the stack trace

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's either validation being run or a type conversion exception.
 
Neeraj Vij
Ranch Hand
Posts: 315
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I updated the struts.xml . it was just a hit and trial method.



changed the result name from "success" to "input" in action "kanjiexternalUserProfileSuccess"and it's working.

is it required to have a result name "input" when you are redirecting the control to the same jsp page rather than sending the control to some other jsp/action.

In the above case Action name was also the same.

I am still not sure about the reason.. any guidance will be a great help.

Thanks
Neeraj.



 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it's not required to have an "input" result.

I told you the reason; it's either a validation or type conversion issue. You didn't post the form or the action to which it submits, so it's impossible to help any further.
 
Neeraj Vij
Ranch Hand
Posts: 315
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I had given the form submission line of jsp in my previous post. here it's again



validation was also happening in the Action Class.

please help, why validations can create the problem.

Thanks,
Neeraj.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How will the form tag tell me what's in the form and what's in the action?!

If there are validation errors (or type conversion issues) the framework sends the browser back to the form so the things that didn't pass validation can be corrected. By default this is the "input" result.
 
Neeraj Vij
Ranch Hand
Posts: 315
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for not being able to get your words properly.

please elaborate on your wordings "
By default this is the "input" result.
"

if there are validation happenings, then it is required to have an "input" result. Please correct me, if I have misunderstood.

Thanks
Neeraj.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not *required*, as the default can be changed. But by default the "workflow" interceptor will return the "input" result if there are validation errors.
 
Neeraj Vij
Ranch Hand
Posts: 315
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got it..

How can we change the default behavior.

Thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic