Answers

Question and Answer:

  Home  Data Warehouse Developer

⟩ Explain me why do we override the execute method is struts?

As part of Struts Framework, we can develop the Action Servlet, ActionForm servlets (ActionServlet means what class extends the Action class, and ActionForm means what class extends the Action Form class) and other servlet classes.

In case of ActionForm class, we can develop validate() method. This method will return the ActionErrors object. In this method we can write the validation code. If this method returns null or ActionErrors with size=0, the web container will call execute() as part of the Action class.

If it returns size > 0, it will not call the execute() method. It will rather execute the jsp, servlet or html file as value for the input attribute as part of the attribute in struts-config.xml file.

 133 views

More Questions for you: