Faraz,
I think at this point some code would help. Could you post your
struts.xml, and the action?
Andy.
On 10 Dec 2008, at 17:16, Faraz Ali wrote:
Yes Andy, you are right. I added the <result name="input">, but why
it is
executing automatically. It is executed automatically when i start my
application.
On Wed, Dec 10, 2008 at 6:19 PM, Andy Sykes <[EMAIL PROTECTED]> wrote:
Faraz,
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..
Andy.
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-
<http://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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Best Regards,
Faraz Ali
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]