You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bill Johnson <pe...@yahoo.com> on 2007/07/05 17:01:04 UTC

[s2] no result defined error after failed validation - can someone help?

I'm having trouble executing an action after
validation has been performed and fails.

Here is the scenario. I have an update page where
users can update a record in the database. This page
uses the standard struts 2 form and has a submit
button. When I click the submit button, validation
fails as expected and the page is redisplayed  as
expected showing the validation errors. On this same
page I have a "Cancel" link that links back to another
action. If I click this link after a failed validation
I get the following error:

No result defined for action
com.xyz.action.EmployeeAction and result input 

Basically Struts 2 is saying that there is no "input"
result defined for the employee action. That is
correct. There is not an "input" result for that
action because it isn't supposed to have one. I am
simply trying to link the cancel link to that action.
The EmployeeUpdateAction has an "input" result because
it is the action that performs validation and that
works fine.

My question is how to get around Struts 2 trying to
find an "input" result for any other actions that have
nothing to do with the action that is performing the
validation. It appears Struts 2 is "caching" the
"input" result after a failed validation and is 
attaching that result to any subsequent actions.

Any ideas on how to fix this? Is this a bug in Struts
2?


-Bill


 
____________________________________________________________________________________
8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [s2] no result defined error after failed validation - can someone help?

Posted by petchia <pe...@yahoo.com>.
Does this mean that errors and messages are stored in the session? If so, is
this configurable? I don't see why the errors would be stored in the session
by default.

-Bill


徐 伟 wrote:
> 
> Try this way, and it might works.
> 
> Make your action beans all implement "com.opensymphony.xwork2.Preparable", 
> and implement a method "prepare()" in your action beans just like this:
> public void prepare() throws Exception
> {
>   // Clear last error messages
>   clearErrorsAndMessages();
> }
> 
> Everytime when you get into these beans, all error messages are completely 
> removed in the cache. And this seems to be working in many conditions.
> 
> _________________________________________________________________
> Don't just search. Find. Check out the new MSN Search! 
> http://search.msn.com/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-s2--no-result-defined-error-after-failed-validation---can-someone-help--tf4030311.html#a11527139
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [s2] no result defined error after failed validation - can someone help?

Posted by Wei Xu <ta...@hotmail.com>.
Try this way, and it might works.

Make your action beans all implement "com.opensymphony.xwork2.Preparable", 
and implement a method "prepare()" in your action beans just like this:
public void prepare() throws Exception
{
  // Clear last error messages
  clearErrorsAndMessages();
}

Everytime when you get into these beans, all error messages are completely 
removed in the cache. And this seems to be working in many conditions.

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! 
http://search.msn.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org