• +91 9723535972
  • info@interviewmaterial.com

Struts Interview Questions and Answers

Question - How can I avoid validating a form before data is entered?

Answer - The simplest way is to have two actions. The first one has the job of setting the form data, i.e. a blank registration screen. The second action in our writes the registration data to the database. Struts would take care of invoking the validation and returning the user to the correct screen if validation was not complete. The EditRegistration action in the struts example application illustrates this: < action path="/editRegistration"> type="org.apache.struts.webapp.example.EditRegistrationAction" attribute="registrationForm" scope="request" validate="false"> When the /editRegistration action is invoked, a registrationForm is created and added to the request, but its validate method is not called. The default value of the validate attribute is true, so if you do not want an action to trigger form validation, you need to remember to add this attribute and set it to false.

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners