Two Laptop Bag*
The moose likes Struts and the fly likes input result propagating to action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "input result propagating to action" Watch "input result propagating to action" New topic
Author

input result propagating to action

Marco Garu
Greenhorn

Joined: Jan 05, 2012
Posts: 3
Hello! I've got an issue i need to solve... i spent some time on it but i couldn't figure a solution!
Basically i've got a loadHome Action which loads some data from a DB and displays the result on the home page of my app. The homepage has no forms or anything, so i just specified a result name="success" for this loadHome Action.
Then i've got another page, suppose it's "form.jsp", where i can fill a form to submit some data, with a -validation file to validate the fields. This form.jsp page is also the "input" result for the submit action.
If i insert some wrong value in the form.jsp form and submit the data, the validation works correctly, it gives me back an "input" result and i correctly see the form.jsp page with all the validation error and messages. Now the problem is the following: if from this point (the input result of the submit action) i call the loadHome Action (suppose via a menu button) i get an error saying that my loadHome Action has no result named "input" in the struts.xml action definition. Now, i know what's the problem, but what i'm not expecting is that the loadHome action is redirecting to the home.jsp propagating the input result given by the form submit action!
I hope i made the situation clear enough!

Has anybody experienced this situation? Any help will be greatly appreciated!
ganapathi pudi
Greenhorn

Joined: Apr 29, 2012
Posts: 10
Understanding of my knowledge .for calling loadHome action(another time/while not submit) with different method with same action . configure that action with another method specified your own results.
Marco Garu
Greenhorn

Joined: Jan 05, 2012
Posts: 3
The logic flow is a bit different, i'll try to explain better here:

home.jsp page -> LoadFormPage action, result success -> formPage.jsp
formPage.jsp, i submit some wrong data which wont pass the validation -> SubmitForm action, result input -> formPage.jsp with field errors shown
formformPage.jsp with field errors shown -> LoadHome action (pressing a menu link to home) RESULT INPUT ->home.jsp

Now my point is, why is the result INPUT propagating to the LoadHome action? Being a redirect action i would expect a result SUCCESS!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: input result propagating to action
 
Similar Threads
Struts2 Validations problem
struts2 validation result input cannot be an action?
I need help with this situation regarding form post parameters
On mysterious error returned to login page?
NullPointerException