Skip to main content

Important Web Design and Development Short Questions

Chapter: 40
Question 1:
In the MVC Model 2 architecture, what role does the JSP play in the application?
Answer: In MVC Model 2, JSPs serve as the view layer. They are responsible for displaying data and presenting it to the user, but they do not contain much processing logic.
Chapter: 40
Question 2:
How does the controller differentiate between different requests in the MVC Model 2 architecture?
Answer: The controller differentiates requests using the "action" parameter in the form or hyperlink query strings. It processes the parameter to determine which view or action to perform next.
Chapter: 40
Question 3:
What is the purpose of the PersonDAO class in the address book example?
Answer: The PersonDAO class manages database operations, including retrieving and storing person records. It interacts with the database to perform CRUD operations based on the provided PersonInfo objects.
Chapter: 40
Question 4:
Describe the function of the PersonInfo JavaBean in the address book example.
Answer: The PersonInfo JavaBean represents a person record, encapsulating properties such as name, address, and phone number. It provides getter and setter methods to access and modify these properties.
Chapter: 40
Question 5:
What is the role of the controller.jsp page in the MVC Model 2 architecture for the address book application?
Answer: The controller.jsp page acts as a central point for processing requests. It identifies the originating page, interacts with JavaBeans to perform operations like saving or searching, and forwards or redirects the user to the appropriate view.
Chapter: 40
Question 6:
Why is it suggested to use a servlet rather than JSP as a controller in the MVC architecture?
Answer: JSPs are designed for presentation, not for processing logic. Using a servlet as a controller separates the processing logic from the presentation layer, making the architecture cleaner and adhering to the MVC pattern more effectively.
Chapter: 40
Question 7:
How can exceptions be handled in a servlet when using MVC architecture?
Answer: Exceptions can be handled by setting the exception object as a request attribute and forwarding the request to an error JSP page. This allows centralized error handling and user-friendly error reporting.
Chapter: 41
Question 8:
What is the primary difference between layers and tiers in software architecture?
Answer: Layers refer to the logical grouping of software components based on their functionalities, while tiers refer to the physical separation of these layers across different servers or machines.
Chapter: 41
Question 9:
What are the three main layers in a typical layered architecture?
Answer: The three main layers are the Presentation Layer, Business Layer, and Data Layer.
Chapter: 41
Question 10:
What is the role of the Presentation Layer in a layered architecture?
Answer: The Presentation Layer provides the user interface, handles user input, validates it, and controls the display of results and navigation.