• +91 9723535972
  • info@interviewmaterial.com

Struts Interview Questions and Answers

Struts Interview Questions and Answers

Question - 91 : - How tag libraries are defined in Struts?

Answer - 91 : -

Tag libraries are defined in the configuration file (web.xml) inside tag as follows:


/WEB-INF/struts-bean.tld

/WEB-INF/struts-bean.tld

Question - 92 : - What’s the significance of logic tags in Struts?

Answer - 92 : - Use of logic tags in Struts helps in writing a clean and efficient code at presentation layer without use of scriptlets.

Question - 93 : - What are the two scope types for formbeans?

Answer - 93 : -

1. Request Scope: Formbean values are available in the current request only

2. Session Scope: Formbean values are available for all requests in the current session.

Question - 94 : - How can we group related actions in one group in Struts?

Answer - 94 : - To group multiple related actions in one group, we can use DispatcherAction class.

Question - 95 : - When should we use SwtichAction?

Answer - 95 : - The best scenario to use SwitchAction class is when we have a modular application with multiple modules working separately. Using SwitchAction class we can switch from a resource in one module to another resource in some different module of the application.

Question - 96 : - What are the benefits of Struts framework?

Answer - 96 : - Struts is based on MVC and hence there is a good separation of different layers in Struts which makes Struts applications development and customization easy. Use of different configuration files makes Struts applications easily configurable. Also, Struts is open source and hence, cost effective.

Question - 97 : - What steps are required to for an application migration from Struts1 to Struts2?

Answer - 97 : -

Following Steps are required for Struts1 to Struts2 migration:

  • Move Struts1 actionForm to Struts2 POJO.
  • Convert Struts1 configuration file (struts-config.xml) to Struts2 configuration file (struts.xml)

Question - 98 : - How properties of a form are validated in Struts?

Answer - 98 : - For validation of populated properties, validate() method of ActionForm class is used before handling the control of formbean to Action class.

Question - 99 : - What’s the use of reset method of ActionForm class?

Answer - 99 : - Reset method of actionForm class is used to clear the values of a form before initiation of a new request.

Question - 100 : - What are disadvantages of Struts?

Answer - 100 : -

Although Struts have large number of advantages associated, it also requires bigger learning curve and also reduces transparency in the development process.

Struts also lack proper documentation and for many of its components, users are unable to get proper online resources for help.


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners