Struts Interview Questions and Answers

Last updated on Feb 02, 2022
  • Share
Struts Interview Questions

Most Frequently Asked Struts Interview Questions

Here in this article, we will be listing frequently asked Struts Interview Questions and Answers with the belief that they will be helpful for you to gain higher marks. Also, to let you know that this article has been written under the guidance of industry professionals and covered all the current competencies.

Q21. How we can configured action mapping in Struts?
Answer

To configure the Struts2 action mapping we have to add an action node inside the configuration file struts.xml.

Here is an example for this:

<action name="*welcome" class="example.action.mapping.LinkAction" method="execute">

     <result name="success">/welcome.jsp</result>

     <result name="error">/error.jsp</result>

</action>

Q22. Which technologies can be used at View Layer in Struts?
Answer

You can use the following technologies in the view layer in Struts:

  • JSP
  • HTML
  • XML/XSLT
  • WML Files
  • Velocity Templates
  • Servlets
Q23. Lists the bundled validators in Struts?
Answer

Struts framework offers a number of built-in validators which are called as bundled validators. These validators are for input validations such as email, phone number, user id.

Struts offer the following bundled validators.

  • requiredstring validator
  • stringlength validator
  • email validator
  • date validator
  • int validator
  • double validator
  • url validator
  • regex validator
Q24. What is the use of jsonValidation in struts?
Answer

jsonValidation interceptor is utilized to perform AJAX validation.

Q25. Explain the difference between plain-validator and field-validator in Struts?
Answer

Field validators

  • Act on single fields that are accessible through action
  • More generic
  • Offer validations in full content

Non-field validators

  • Only add action level messages
  • Mostly domain specific
  • Offer custom implementations
  • Allows to declare both types of validators
Reviewed and verified by Best Interview Question
Best Interview Question

With our 10+ experience in PHP, MySQL, React, Python & more our technical consulting firm has received the privilege of working with top projects, 100 and still counting. Our team of 25+ is skilled in...