Download presentation
Presentation is loading. Please wait.
Published byCharity Atkinson Modified over 9 years ago
1
Chapter 3 JSP Overview
2
The Problem with Servlets processing the request and generating the response are both handled by a single servlet class Java programming knowledge is needed to develop and maintain all aspects of the application Changing the look and feel of the application, or adding support for a new type of client requires the servlet code to be updated and recompiled It's hard to take advantage of web page development tools when designing the application interface
4
The Advantage of JSP separating the request processing and business logic from presentation makes it possible to divide the development tasks among people with different skills
5
The Anatomy of a JSP Page
6
JSP Processing When a JSP page request is processed, the template text and dynamic content generated by the JSP elements are merged, and the result is sent as the response to the browser
7
JSP Processing the server needs a JSP container to process JSP pages The JSP container initiates the translation phase for a page automatically when it receives the first request for the page turns the JSP page into a servlet compiles the servlet class precompilation of a JSP page request processing phase: invoking the JSP page implementation class As long as the JSP page remains unchanged, any subsequent request goes straight to the request processing phase When the JSP page is modified, it goes through the translation phase again it's loaded once and called repeatedly, until the server is shut down
8
JSP page translation and processing phases
9
JSP Elements Directive Action scripting Expression Language (EL) expression JavaBeans components
10
JSP Elements Directive elements
11
JSP Elements Standard action elements
12
JSP Elements Custom action elements The JSP Standard Tag Library (JSTL)
13
JSP Elements Scripting elements allow you to add small pieces of code (typically Java code) in a JSP page
14
JSP Elements Expression Language expressions JavaBeans components a JavaBeans component is a Java class that complies with certain coding conventions components are typically used as containers for information that describes application entities, such as a customer or an order
15
JSP Application Design with MVC MVC roles in a pure JSP scenario
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.