Review: Integrating Servlets
and JSP
Use MVC (Model 2) approach when:
One submission will result in multiple basic looks
Several pages have substantial common processing
Architecture
A servlet answers the original request
Servlet does the real processing & stores results in beans
Beans stored in HttpServletRequest, HttpSession, or
ServletContext
Servlet forwards to JSP page via forward method of
RequestDispatcher
JSP page reads data from beans by means of jsp:useBean
with appropriate scope (request, session, or application)
121
JSP
www.corewebprogramming.com
More Information
Core Servlets and JavaServer Pages
http://www.coreservlets.com
More detail on all topics presented here
More Servlets and
JavaServer Pages
http://www.moreservlets.com
New features in servlets 2.3 and JSP 1.2 (filters and
listeners), Web applications, security, standard JSP tag
library
Servlet home page
http://java.sun.com/products/servlet/
JavaServer Pages home page
http://java.sun.com/products/jsp/
122
JSP
www.corewebprogramming.com
61