Java Web Application Request Handling
Java Web Application Request Handling
Servlets are Java programming language classes that dynamically process requests and construct
responses. JSP pages are text-based documents that execute as servlets but allow a more natural
approach to creating static content. Although servlets and JSP pages can be used
interchangeably, each has its own strengths. Servlets are best suited for service-oriented
applications (web service endpoints are implemented as servlets) and the control functions of a
presentation-oriented application, such as dispatching requests and handling nontextual data.
JSP pages are more appropriate for generating text-based markup such as HTML, Scalable
Vector Graphics (SVG), Wireless Markup Language (WML), and XML.
Since the introduction of Java Servlet and JSP technology, additional Java technologies and
frameworks for building interactive web applications have been developed.
illustrates these technologies and their relationships.
Web
Client
HttpServlet
Request
HttpServlet
Response
Web Server
HTTP
Request
HTTP
Response
1
Web
Components
Web
Components
Web
Components
Web
Components
Web
Components
JavaBeans
Components
2
3
4
5
4
6
FIGURE 31
Java Web Application Request Handling
Web Applications
The Java EE 5 Tutorial · September 2007
78