JSP is java based technology which is used to simplify the development of the dynamic webpage. JSP is used to separate the dynamic content of the web page from its content with the help of HTML and JSP tags.
There are two JSP Model Architecture:
Features of MVC:
- Clients do not request pages directly. All clients requests go to controller servlet.
- Each request includes data i.e; the request action, any parameter for that action.
- Controller servlet decides which page should be returned to the user, augment requests object with data to be displayed to the user.
Advantages of MVC:
- MVC approach simplifies JSP pages by providing no navigation code inside them and no complete data manipulation.
- Clean separation of presenting and processing logic.
- The front components present a single point of entry into the application, thus making the management of application state, security, and presentation uniform and easier to maintain.
- Multiple views using the same model.
The processing is divided between presentation (JSPs) and controllers(front components). Presentation components are JSP pages that generate HTML/XML response that determines the user interface rendered by the browser. Front components do not handle any presentation issues, but rather process, all the HTTP request. They are responsible for creating beans or object used by presentation components, as well as for deciding, depending on the user’s action which presentation component to forward the request to. The front component can either be implemented as servlet or JSP.
Controller’s Responsibilities:
- Request processing
- Creation of any beans or objects used by the presentation JSP.
- Deciding, depending on the user’s action, which JSP to forward the request to.
- Data validation
View Responsibilities:
There is no processing logic within the presentation JSP itself: it is simply responsible for retrieving the objects that may be previously created by the servlet and extracting the dynamic content for insertion with static templates.
Last Updated :
18 Jul, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...