struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Sykes <>
Subject Re: Please help! Validation Errors
Date Wed, 10 Dec 2008 10:19:28 GMT

When using validation, the input result tells Struts where to dispatch/ 
redirect to if there's a validation error. When you submit the form,  
Struts checks the fields against the validation XML - if there's an  
error, it adds FieldError objects to the FieldErrors object on the  
value stack, and dispatches to the JSP (or other resource) defined in  
the input result element. This is nearly always the JSP containing the  
form you submitted from.

You have to have a <result name="input"> because Struts has to know  
where to redirect in the event of a validation error.

Not sure what you mean by the last bit of your question..


On 10 Dec 2008, at 05:56, Faraz Ali wrote:

> 13:45:18,390 ERROR [ActionComponent] Could not execute action: /web/ 
> MyAction
> No result defined for action com.web.actions.MyAction and result  
> input -
> action - file:/C:/
> jboss-4.2.3.GA/server/default/tmp/deploy/tmp35854MyWeb-exp.war/WEB- 
> INF/classes/struts.xml:12:69
> 1. I have a simple Action class MyAction
> 2. A corresponding MyAction-validation.xml present in same location as
> Action class
> 3. <s:fielderror /> is included in jsp
> 4. No <result name="input"> is present
> My Question is why do we need this input element? Because i want to  
> control
> it my way. And if i add this input element, its opening the jsp page  
> at the
> start of the application. Can anybody help me how to do validation  
> properly
> in struts2 application?
> -- 
> Best Regards,
> Faraz Ali

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message