• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for a prompt reply

following is the jsp fragment


and

following is the stack trace

 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's either validation being run or a type conversion exception.
 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
got it..

How can we change the default behavior.

Thanks
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://struts.apache.org/2.x/docs/workflow-interceptor.html
reply
    Bookmark Topic Watch Topic
  • New Topic