Questions of Test: Struts interview questions 1

More >>

1

You are given a POJO class HelloWorldAction with a execute() signature that is currently used as a Struts 2 Action class. You are asked to make changes to the class to access the HttpServletResponse object. 
 
Which of the following steps will you do?

2

Which of the following statements are true in Struts 2?

3

You are developing a web application with over 100 Action classes. There is a strong contention in your team for struts.xml file in the Version Control tool. 
 
What is the best practice to resolve this?

4

Which of the following is true about the configuration below done in struts.properties? 
 
struts.custom.i18n.resources=eTattva1,eTattva2 

5

Which of the following code snippet will change the default i18n parameter "request_locale" to "myPrefLocale" for a action class TestAction in the package com.eTattva.tests?

6

Which of the following statement(s) is true about Struts 2?

7

You have created a action class called TakeTestAction to dispatch to takeTest.jsp and have configured in struts.xml. The class has only one method named perform() and does not have execute() method. 
 
Which of the following is true?

8

You have written a Action class with multiple methods create(), update() and delete().  
 
But, you are asked to configure 3 distinct actions in struts.xml. Which of the following is the best way to implement?

9

What will be output when you try call http://<server>/<contextroot>/DisplayResultAction.action 
 
<package name="Test" extends="action-default"> 
 
   <default-action-ref name="CatchAll"> 
 
    <action name="DisplayResultAction"> 
      <result>/displayResult.jsp</result> 
    </action> 
    
    <action name="CatchAll"> 
      <result>/catchall.jsp</result> 
    </action> 
 
</package>

10

Which of the following is not a valid default result name token in Struts 2? 

More >>