servlets
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| servlets [2007/10/09 18:17] – roumani | servlets [2008/10/08 19:36] (current) – roumani | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| ===== Outline ===== | ===== Outline ===== | ||
| - | == The Architecture == | + | == Tomcat as a Framework == |
| + | * Infrastructural services (networking, | ||
| + | * Persistence and session management | ||
| + | * Events (context and session listeners) | ||
| + | * Filters | ||
| + | * Declarative security | ||
| + | |||
| + | == Architecture == | ||
| * Tomcat = Coyote + Catalina + Jasper. It is a reference implementation of Sun's Servlet/JSP standards. | * Tomcat = Coyote + Catalina + Jasper. It is a reference implementation of Sun's Servlet/JSP standards. | ||
| - | * Coyote is a connector, Catalina is a servlet container, and Jasper is a JSP compiler. | + | |
| - | * Client uses HTTP to reach a Web Server which has a module (Apache) or a plug-in (IIS) for JK filtering. | + | |
| - | * The web server uses NFS to serve static | + | * Client uses HTTP to reach Coyote over TCP/IP; Coyote consults its URL mappings to determine how to serve: traditionally (NFS for static, CGI, or PHP/SSI) or via delegating |
| - | * You supply your servlet subclass to Catalina | + | * Catalina |
| - | * Coyote today comes with an HTTP version that bypasses the JK protocol; i.e. it acts as a web server | + | * Jasper turns JSP documents into servlets. Think of it as a JSP compiler. |
| - | * To enable MVC, servlets are used as controllers, | + | * Coyote can also operate as a connector to an existing |
| + | |||
| + | == The MVC Design Pattern == | ||
| + | * Separation of concerns | ||
| + | * Controller = servlet | ||
| + | * Model = POJO | ||
| + | * View = JSP | ||
| == The Life Cycle == | == The Life Cycle == | ||
| Line 25: | Line 38: | ||
| * There is no client-to-thread mapping: the same client may get served by the same or a different thread. | * There is no client-to-thread mapping: the same client may get served by the same or a different thread. | ||
| * When it is time to stop this servlet, the server invokes its '' | * When it is time to stop this servlet, the server invokes its '' | ||
| + | |||
| + | == The Directory Structure == | ||
| + | * The subdirectories bin and conf | ||
| + | * The lib subdirectory | ||
| + | * The subdirectories logs and work | ||
| + | * The projects root: webapps | ||
| + | * The role of WEB-INF vis-a-vis visibility | ||
| + | * The subdirectories of WEB-INF: classes and lib | ||
| + | * The web.xml file | ||
| + | * Deploying war files | ||
| + | * The manager application | ||
| == The API == | == The API == | ||
| Line 31: | Line 55: | ||
| * Note that parameters are available as Map< | * Note that parameters are available as Map< | ||
| * The response object allows you to set the HTTP response line and headers as well as the payload. | * The response object allows you to set the HTTP response line and headers as well as the payload. | ||
| - | |||
| ===== To Do ===== | ===== To Do ===== | ||
| - | |||
| * Read Sections 6.1 through 6.5 of our textbook. | * Read Sections 6.1 through 6.5 of our textbook. | ||
| - | * Come to Prism on Thu for a hands-on lecture | + | * Take an overall look at the servlet API (accessible from our // |
| + | * Complete and then review Lab-3 | ||
servlets.1191953877.txt.gz · Last modified: by roumani
