As part of Struts FrameWork we can decvelop the Action Servlet,ActionForm servlets(here ActionServlet means which class extends the Action class is called ActionServlet and ActionFome means which calss extends the ActionForm calss is called the Action Form servlet)and other servlets classes.<br><br>In case of ActionForm class we can develop the validate().this method will return the ActionErrors object.In this method we can write the validation code.If this method return null or ActionErrors with size=0,the webcontainer will call the execute() as part of the Action class.if it returns size > 0 it willnot be call the execute().it will execute the jsp,servlet or html file as value for the input attribute as part of the <action -mapping> attribute in struts-config.xml file.<br><br>In case of Action class the execute() method retuen the ActionForward object.in execute() we can write (return mapping.findForward("success");)here mapping is the object for the ActionMapping class.After that it will forward the request to the "success" jsp file.(here success is context path for the jsp file,it is written in web.xml. <br>
Category:Struts Interview Questions
No comments:
Post a Comment