Logo F2FInterview

Struts Interview Questions

Q   |   QA

The tag to allow front-end validation based on the xml in validation.xml. For example the code: generates the client side java script for the form logonForm as defined in the validation.xml file. The when added in the jsp file generates the client site validation script.

ActionForm class is used to capture user-input data from an HTML form and transfer it to the Action Class. ActionForm plays the role of Transport Vehicle between the presentation Tire & Business Tier.
Life Cycle :

  1. Request received by Controller
  2. Create or recycle ActionForm
  3. Call reset()
  4. storeActionForm in proper scope
  5. populateActionForm from Request
  6. Validate the ActionForm
  7. If errors found then forward back to input attribute page(configured in Action mapping in struts-config.xml) with ActionForm in scope. If no errors found then call execute() with the ActionForm.

The steps would be like this

  1. Client will point to the controller
  2. Controller would point to action form
  3. Actionform would point to action class
  4. Action class would point to JSP?
  5. JSP would point to client

There are two types of Controllers in Strus.
1.  Main Controller/FrontController
     Ex: ActionServlet
2.  Application Controller
     Ex:Action Class

The web container do not need to know about the design pattern we used in our application. Our Struts application is deployed in the web.xml file. The container reads the web.xml file, and acts accordingly.

Yes! One can have more than one struts-config.xml file for a single Struts application. You can define different struts-conifg.xml file for different modules in a single web application. It is useful when you are developing a distributed application.
But you must enter those struts-config.xml files details in deployment descripter (i.e., web.xml) file.
Example:
config /WEB-INF/struts-first-config.xml,/WEB-INF/struts-second-config.xml,/WEB-INF/struts-third-config.xml
Here three struts configutation files are deployed in a single application.

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: