: Struts And Hibernate
Struts and Hibernate Objective Types Questions With Answers and Explanations. Java Programming MCQ Quiz on Struts and Hibernate for various interviews or entrance test.
1. Which of the following methods is overridden by Action class?
Answer: A. execute()
Execute method is overridden by the Action class. As this class in the struts application extends Struts 'org.apache.struts.action.Action" Class
2. Which of the following should always forwards or redirect to a resource (view) after completed?
Answer: D. Request Processor
RequestProcessor consists of the processing logic which is being performed by ActionServlet as it receives each servlet request from the container. The processing behavior of the request can be customized by subclassing this class and overriding the method(s) as per the need and demand.
3. Which of the following acts as a bridge between user-invoked URI and a business method?
Answer: B. Action class
An Action class acts as a bridge between user-invoked URI and a business method.
4. What is the limitation of creating ActionServlet instances per web application?
Answer: D. One
Only one instace of ActionServlet can run per web application that is the restriction from the application side. ActionServlet provides the "controller" in the Model-View-Controller (MVC) design pattern for web applications that is commonly known as "Model 2".
5. Which of the following are the struts pre-built Action classes?
Answer: C. ForwardAction,DispatchAction,IncludeAction,LookupDispatchAction,SwitchAction
DispatchAction- provides mechanism to collect related functions into a single action and eliminates the need of creating multiple independent actions for each function.
Answer: A. should always decouple the application from a specific model implementation
The Struts Framework is a standard for developing well-architected Web applications
7. The dispatch from the controller to the Action class is based on a configuration that is provided by a
Answer: D. struts-config.xml
struts.xml provides the configuration for the dispatch from the controller to the Action class
8. Which of the following tags in struts-config.xml file defines the availability of necessary Struts JSP custom tag libraries?
Answer: C. < taglib>
Taglib is a component that is used to provide a set of JSP custom tag libraries. This component helps developers creating interactive form-based applications. There are tags to help with everything from displaying error messages to dealing with nested ActionForm beans.
9. Business delegate pattern
Answer: D. All of the above
Business Delegate Pattern provides a way to decouple presentation tier and business tier. It reduces communication or remote lookup functionality to business tier code in presentation tier code.
10. Which of the java bean tags is used to show the bean value on the web page?
Answer: D. < bean:write>
bean:write is used to show the bean value on the web page.