answersLogoWhite

0


Best Answer

In the context of JSP, the Model-View-Controller (MVC) pattern can be implemented by having the JSP act as the View to display data from the Model (usually Java objects) and the Controller can be represented by servlets or Java classes that handle business logic and interact with the Model. The JSP page is responsible for displaying the data provided by the Controller, maintaining a separation of concerns between the presentation (View) and business logic (Controller).

User Avatar

AnswerBot

1mo ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How MVC work with JSP page?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How jsp used in mvc model?

MVC refers to Model View Controller architecture. Jsp pages are the view part of the MVC architecture...


What is mvc in jsp?

JSP is used for the V part of the MVC Architecture. MVC stands for Model-View-Controller Architecture and JSPs are used for the views.


What is the use of jsp?

JSP stands for Java Server Pages. It is the face of any web application. I.e., the stuff you see on a web page can be JSP contents. The JSP uses the features of both Java and HTML to display dynamic contents on a web page. It interacts with Servlets in a MVC architecture to provide the power to display dynamic and advanced data on any given web page.


How does a servlet and javaserverpages fit in the ModelViewController pattern design?

Servlets form the Controller and JSP the View part of the MVC design pattern


Can I prevent the creation of a session in a JSP page?

Yes you can. Use the below line in your JSP page to accomplish it. <%@ page session="false" %>


What are the Implicit object in JSP?

The implicit objects in a JSP page are:requestresponsepageContextsessionapplicationoutconfigpage


What are the JSP lifecycle methods?

The 3 life cycle methods in a JSP page are:jspInit() - Called when the JSP page is initializedjspService() - Called everytime a request/response is received/submittedjspDestroy() - Called when the JSP is no longer required


When you forward a JSP page which built-in JSP object goes out of scope?

application


Is it possible to include a doc file in a JSP page?

Yes. You can embed spreadsheets, pdfs and word documents in a JSP Page


How many page directive can use in a single JSP?

There is no limit as such. You can use one or more Page Directives in a JSP but you cannot have duplicates


How does a JSP page handle run-time exceptions?

You can use the errorPage attribute of the page directive. If this attribute is defined in a JSP page, when a run time exception is encountered, the control will be transferred to this JSP page. This error page can access details of the Exception from the request and use it to display a logical message to the user.


What is the purpose of page directive in JSP?

The Page Directive is one of the important components of any JSP Page. It can help us define page specific properties like Buffer size or location of an error page etc A JSP page, and any files included via the include directive, can contain one or more page directives but no duplicates. The JSP container will apply all the attributes to the page. The position of these page directives is irrelevant, but it is good practice to keep them together at the top of the page. (So that we can identify them easily)