• +91 9723535972
  • info@interviewmaterial.com

Struts Interview Questions and Answers

Struts Interview Questions and Answers

Question - 81 : - How duplicate form submission can be controlled in Struts?

Answer - 81 : -

In Struts, action class provides two important methods which can be used to avoid duplicate form submissions.

saveToken() method of action class generates a unique token and saves it in the user’s session. isTokenValid() method is used then used to check uniqueness of tokens.

Question - 82 : - In Struts, how can we access Java beans and their properties?

Answer - 82 : - Bean Tag Library is a Struts library which can be used for accessing Java beans.

Question - 83 : - Which configuration file is used for storing JSP configuration information in Struts?

Answer - 83 : - For JSP configuration details, Web.xml file is used.

Question - 84 : - What’s the difference between validation.xml and validator-rules.xml files in Struts Validation framework?

Answer - 84 : -

In Validation.xml, we define validation rules for any specific Java bean while in validator-rules.xml file, standard and generic validation rules are defined.

Question - 85 : - How can we display all validation errors to user on JSP page?

Answer - 85 : - To display all validation errors based on the validation rules defined in validation.xml file, we use tag in our JSP file.

Question - 86 : - What’s declarative exception handling in Struts?

Answer - 86 : -

When logic for exception handling is defined in struts-config.xml or within the action tag, it’s known as declarative exception handling in Struts.

In the following example, we have defined exception in struts-config.xml file for NullPointerException:



Type="java.lang.NullPointerException"

Path="/WEB-INF/errors/error_page.jsp"

Question - 87 : - What’s DynaActionForm?

Answer - 87 : - DynaActionForm is a special type of actionForm class (sub-class of ActionForm Class) that’s used for dynamically creating form beans. It uses configuration files for form bean creation.

Question - 88 : - What configuration changes are required to use Tiles in Struts?

Answer - 88 : -

To create reusable components with Tiles framework, we need to add following plugin definition code in struts-config.xml file:




Question - 89 : - What’s the difference between Jakarta Struts and Apache Struts? Which one is better to use?

Answer - 89 : - Both are same and there is no difference between them.

Question - 90 : - What’s the use of Struts.xml configuration file?

Answer - 90 : - Struts.xml file is one the key configuration files of Struts framework which is used to define mapping between URL and action. When a user’s request is received by the controller, controller uses mapping information from this file to select appropriate action class.


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners