where and how to implement the validate(){} method for validating the data on the form, in struts 2, please help me, Thanks in advance.
where and how to implement the validate(){} method for validating the data on the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I got it, the validate method is delcared in the ActionSupport class and we should override it in our Action class (First we should extend the ActionSupport Class) as follows,
and also you should define your action in strus.xml as follows
here
<result name="input">/Login.jsp</result>this tag is imp bcoz, if dont add this tag the filter dispathcer, wont come to know which page to render if validation-error occur.