• +91 9723535972
  • info@interviewmaterial.com

Struts Interview Questions and Answers

Struts Interview Questions and Answers

Question - 101 : - What’s the use of resourcebundle.properties file in Struts Validation framework?

Answer - 101 : -

resourcebundle.properties file is used to define specific error messages in key value pairs for any possible errors that may occur in the code.

This approach helps to keep the code clean as developer doesn’t need to embed all error messages inside code.

Question - 102 : - Can I have html form property without associated getter and setter formbean methods?

Answer - 102 : - For each html form property, getter and setter methods in the formbean must be defined otherwise application results in an error.

Question - 103 : - How many servlet controllers are used in a Struts Application?

Answer - 103 : - Struts framework works on the concept of centralized control approach and the whole application is controlled by a single servlet controller. Hence, we require only one servlet controller in a servlet application.

Question - 104 : - For a single Struts application, can we have multiple struts-config.xml files?

Answer - 104 : -

We can have any number of Struts-config.xml files for a single application.

We need following configurations for this:


action


org.apache.struts.action.ActionServlet



config


/WEB-INF/struts-config.xml

/WEB-INF/struts-config_user.xml

/WEB-INF/struts-config_admin.xml



.............

.............

Question - 105 : - Which model components are supported by Struts?

Answer - 105 : - Struts support all types of models including Java beans, EJB, CORBA. However, Struts doesn’t have any in-built support for any specific model and it’s the developer’s choice to opt for any model.

Question - 106 : - When it’s useful to use IncludeAction?

Answer - 106 : -

IncludeAction is action class provided by Struts which is useful when an integration is required between Struts and Servlet based application.

Question - 107 : - Is Struts thread safe?

Answer - 107 : - Yes Struts are thread safe. In Struts, a new servlet object is not required to handle each request; rather a new thread of action class object is used for each new request.

Question - 108 : - What configuration changes are required to use resource files in Struts?

Answer - 108 : -

Resource files (.properties files) can be used in Struts by adding following configuration entry in struts-config.xml file:

Question - 109 : - How nested beans can be used in Struts applications?

Answer - 109 : -

Struts provide a separate tag library (Nested Tag Library) for this purpose. Using this library, we can nest the beans in any Struts based application.

Question - 110 : - What are the Core classes of Struts Framework?

Answer - 110 : -

Following are the core classes provided by Struts Framework:

  • Action Class
  • ActionForm Class
  • ActionMapping Class
  • ActionForward Class
  • ActionServlet Class


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners