- Struts 2 Tutorial
- Struts2 - Home
- Struts2 - Basic MVC Architecture
- Struts2 - Overview
- Struts2 - Environment Setup
- Struts2 - Architecture
- Struts2 - Examples
- Struts2 - Configuration
- Struts2 - Actions
- Struts2 - Interceptors
- Struts2 - Result Types
- Struts2 - Value Stack/OGNL
- Struts2 - File Uploads
- Struts2 - Database Access
- Struts2 - Sending Email
- Struts2 - Validations
- Struts2 - Localization
- Struts2 - Type Conversion
- Struts2 - Themes/Templates
- Struts2 - Exception Handling
- Struts2 - Annotations
- Struts 2 Integrations
- Struts2 - Spring
- Struts2 - Tiles
- Struts2 - Hibernate
- Struts 2 Useful Resources
- Struts2 - Questions and Answers
- Struts2 - Quick Guide
- Struts2 - Useful Resources
- Struts2 - Discussion
Struts2 Mock Test
This section presents you various set of Mock Tests related to Struts2. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
Struts2 Mock Test IV
Q 1 - Which of the following tag takes two or more lists as parameters and append them all together?
Answer : D
Explanation
These merge tag take two or more lists as parameters and append them all together.
Q 2 - Which of the following tag generates an iterator based on the val attribute supplied?
Answer : A
Explanation
These generator tag generates an iterator based on the val attribute supplied.
Q 3 - Which of the following tag enables developers to call actions directly from a JSP page by specifying the action name and an optional namespace?
Answer : B
Explanation
The action tag enables developers to call actions directly from a JSP page by specifying the action name and an optional namespace. The body content of the tag is used to render the results from the Action.
Q 4 - Which of the following tag is to be used to include a JSP file in another JSP page?
Answer : C
Explanation
The include tag will be used to include a JSP file in another JSP page.
Q 5 - Which of the following tag instantiates a class that conforms to the JavaBeans specification?
Answer : D
Explanation
The bean tag instantiates a class that conforms to the JavaBeans specification. This tag has a body which can contain a number of Param elements to set any mutator methods on that class. If the var attribute is set on the BeanTag, it will place the instantiated bean into the stack's Context.
Q 6 - Which of the following tag will allow you to format a Date in a quick and easy way?
Answer : A
Explanation
The date tag will allow you to format a Date in a quick and easy way.
Q 7 - Which of the following tag can be used to parameterize other tags?
Answer : B
Explanation
The param tag can be used to parameterize other tags.
Q 8 - Which of the following tag is used to get the property of a value, which will default to the top of the stack if none is specified?
Answer : C
Explanation
The property tag is used to get the property of a value, which will default to the top of the stack if none is specified.
Q 9 - Which of the following tag is used to push value on stack for simplified usage?
Answer : D
Explanation
The push tag is used to push value on stack for simplified usage.
Q 10 - Which of the following tag assigns a value to a variable in a specified scope?
Answer : A
Explanation
The set tag assigns a value to a variable in a specified scope. It is useful when you wish to assign a variable to a complex expression and then simply reference that variable each time rather than the complex expression. The scopes available are application, session, request, page and action.
Q 11 - Which of the following tag is used to render a I18n text message?
Answer : B
Explanation
The text tag is used to render a I18n text message.
Q 12 - Which of the following tag is used to create a URL?
Answer : C
Explanation
The url tag is used to create a URL.
Answer : A
Explanation
Struts uses the DOJO framework for the AJAX tag implementation.
Q 14 - Which of the following class acts as Listener class in struts and spring integration?
A - org.springframework.web.context.ContextLoaderListener
Answer : A
Explanation
org.springframework.web.context.ContextLoaderListener acts as Listener class in struts and spring integration.
Q 15 - Which of the following class acts as Dispatcher class in struts and spring integration?
A - org.springframework.web.context.ContextLoaderListener
Answer : B
Explanation
org.apache.struts2.dispatcher.FilterDispatcher acts as Dispatcher class in struts and spring integration.
Q 16 - Which of the following is true in struts and spring integration?
A - The ContextLoaderListener is required to load the spring context file.
Answer : C
Explanation
Both of the above statements are correct.
Q 17 - Which of the following is true in Struts and Apache tiles integration?
A - We need to tell tiles, where to find tiles configuration file tiles.xml.
B - We need to initialize the Tiles listener that comes with Struts2 download.
Answer : C
Explanation
Both of the above statements are correct.
Q 18 - Struts2 is popular and mature web application framework based on the MVC design pattern.
Answer : A
Explanation
Struts2 is popular and mature web application framework based on the MVC design pattern.
Answer : B
Explanation
Struts2 offers integrated profiling to debug and profile the application. In addition to this, Struts also offers integrated debugging with the help of built in debugging tools.
Answer : A
Explanation
Tag markups in Struts2 can be tweaked using Freemarker templates. This does not require JSP or java knowledge. Basic HTML, XML and CSS knowledge is enough to modify the tags.
Q 21 - Struts2 promotes less configuration with the help of using default values for various settings.
Answer : A
Explanation
Struts2 promotes less configuration with the help of using default values for various settings. You don't have to configure something unless it deviates from the default settings set by Struts2.
Answer : B
Explanation
Struts2 has a great support for multiple view options (JSP, Freemarker, Velocity and XSLT).
Q 23 - To use MVC with Struts, you have to be comfortable with the standard JSP, Servlet APIs and a large & elaborate framework.
Answer : B
Explanation
To use MVC with Struts, you have to be comfortable with the standard JSP, Servlet APIs and a large & elaborate framework.
Q 24 - With Struts applications, there is a lot more going on behind the scenes than with normal Java-based Web applications.
Answer : A
Explanation
With Struts applications, there is a lot more going on behind the scenes than with normal Java-based Web applications.
Q 25 - The web.xml configuration file is a J2EE configuration file that determines how elements of the HTTP request are processed by the servlet container.
Answer : B
Explanation
The web.xml configuration file is a J2EE configuration file that determines how elements of the HTTP request are processed by the servlet container.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | |
21 | |
22 | |
23 | |
24 | |
25 |