INSIDE SERVLETS. Server-Side Programming for the Java Platform. An Imprint of Addison Wesley Longman, Inc.



Similar documents
ACM Crossroads Student Magazine The ACM's First Electronic Publication

Windows Sockets Network Programming

11.1 Web Server Operation

The Unified Software Development Process

Building Java Servlets with Oracle JDeveloper

Introduction to J2EE Web Technologies

Java Servlet Specification Version 2.3

Java Thin-Client Programming for a Network Computing Environment

Java EE Introduction, Content. Component Architecture: Why and How Java EE: Enterprise Java

CIS 455/555: Internet and Web Systems

CSc31800: Internet Programming, CS-CCNY, Spring 2004 Jinzhong Niu May 9, Java Servlets

Outline. Lecture 9: Java Servlet and JSP. Servlet API. HTTP Servlet Basics

Java Servlet Specification

Ch-03 Web Applications

Please send your comments to:

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

CHAPTER 5. Java Servlets

Java Servlet Specification Version 2.5 MR6

INTRODUCTION TO WEB TECHNOLOGY

Servlet 3.0. Alexis Moussine-Pouchkine. mercredi 13 avril 2011

Deliuery Networks. A Practical Guide to Content. Gilbert Held. Second Edition. CRC Press. Taylor & Francis Group

Building Web Applications, Servlets, JSP and JDBC

SSC - Web applications and development Introduction and Java Servlet (II)

Web Container Components Servlet JSP Tag Libraries

Class Focus: Web Applications that provide Dynamic Content

Managing Data on the World Wide-Web

Pure server-side Web Applications with Java, JSP. Application Servers: the Essential Tool of Server-Side Programming. Install and Check Tomcat

Course Number: IAC-SOFT-WDAD Web Design and Application Development

Agenda. Summary of Previous Session. Application Servers G Session 3 - Main Theme Page-Based Application Servers (Part II)

Architecture Design For Web-based Application Systems. Instructor: Dr. Jerry Gao Class: CMPE296U

In this chapter the concept of Servlets, not the entire Servlet specification, is

10. Java Servelet. Introduction

Course Name: Course in JSP Course Code: P5

PYTHON IN A NUTSHELL. O'REILLY Beijing Cambridge Farnham Köln Sebastopol Taipei Tokyo. Alex Martelli. Second Edition

Web Application Development

Java 2 Web Developer Certification Study Guide Natalie Levi

If your organization is not already

The Server.xml File. Containers APPENDIX A. The Server Container

Database Applications Recitation 10. Project 3: CMUQFlix CMUQ s Movies Recommendation System

Protocolo HTTP. Web and HTTP. HTTP overview. HTTP overview

Principles and Techniques of DBMS 5 Servlet

Internet Technologies. World Wide Web (WWW) Proxy Server Network Address Translator (NAT)

Università degli Studi di Napoli Federico II. Corsi di Laurea Specialistica in Ingegneria Informatica ed Ingegneria delle Telecomunicazioni

CTIS 256 Web Technologies II. Week # 1 Serkan GENÇ

Exam Prep. Sun Certified Web Component Developer (SCWCD) for J2EE Platform

Check list for web developers

Servlets. Based on Notes by Dave Hollinger & Ethan Cerami Also, the Online Java Tutorial by Sun

IT6503 WEB PROGRAMMING. Unit-I

Creating Java EE Applications and Servlets with IntelliJ IDEA

Web application development landscape: technologies and models

Detailed Table of Contents

How To Understand The History Of The Web (Web)

Java Servlet 3.0. Rajiv Mordani Spec Lead

Last update: February 23, 2004

2.8. Session management

Tomcat 5 New Features

Anonymity on the Internet Over Proxy Servers

Lecture 11 Web Application Security (part 1)

Application Layer -1- Network Tools

Web Hosting & Maintenance

CS108, Stanford Handout #33 Young. HW5 Web

Introduction to Computer Security

1 Introduction: Network Applications

Java Servlet Tutorial. Java Servlet Tutorial

Computer Networks. Lecture 7: Application layer: FTP and HTTP. Marcin Bieńkowski. Institute of Computer Science University of Wrocław

How To Understand The Architecture Of An Ulteo Virtual Desktop Server Farm

A detailed walk through a CAS authentication

Pass Through Proxy. How-to. Overview:..1 Why PTP?...1

Step into the Future: HTML5 and its Impact on SSL VPNs

reference: HTTP: The Definitive Guide by David Gourley and Brian Totty (O Reilly, 2002)

DEPLOYMENT GUIDE DEPLOYING F5 WITH MICROSOFT WINDOWS SERVER 2008

-8*6-DYD6HPLQDU 6HUYOHW$UFKLWHFWXUHV 5DLQHU+LVV$QGUHDV.DSS 6<6725$*

Core Java+ J2EE+Struts+Hibernate+Spring

Internet infrastructure

A Java proxy for MS SQL Server Reporting Services

InduSoft Thin Client Setup and Troubleshooting Guide

Outline Definition of Webserver HTTP Static is no fun Software SSL. Webserver. in a nutshell. Sebastian Hollizeck. June, the 4 th 2013

Web Application Security Assessment and Vulnerability Mitigation Tests

An introduction to web programming with Java

7 Why Use Perl for CGI?

Eclectic Computing. Time Tracking Tool Software Architecture Document. Version <1.3>

Java the UML Way: Integrating Object-Oriented Design and Programming

LabVIEW Internet Toolkit User Guide

Developing Web Applications using JavaServer Pages and Servlets

PA165 - Lab session - Web Presentation Layer

TCP/IP Illustrated, Volume 2 The Implementation

WWW. World Wide Web Aka The Internet. dr. C. P. J. Koymans. Informatics Institute Universiteit van Amsterdam. November 30, 2007

Course Description. Course Audience. Course Outline. Course Page - Page 1 of 5

HTTP. Internet Engineering. Fall Bahador Bakhshi CE & IT Department, Amirkabir University of Technology

S y s t e m A r c h i t e c t u r e

Design Notes for an Efficient Password-Authenticated Key Exchange Implementation Using Human-Memorable Passwords

DEPLOYMENT GUIDE DEPLOYING THE BIG-IP SYSTEM WITH MICROSOFT INTERNET INFORMATION SERVICES (IIS) 7.0

Transcription:

INSIDE SERVLETS Server-Side Programming for the Java Platform Dustin R. Callaway TT ADDISON-WESLEY An Imprint of Addison Wesley Longman, Inc. Reading, Massachusetts Harlow, England Menlo Park, California Berkeley, California Don Mills, Ontario Sydney Bonn Amsterdam Tokyo Mexico City

CONTENTS Preface Introduction PART I Introduction to Web Development Chapter I Chapter 2 Networks Protocols TCP/IP Internet Basics Brief History of the Internet Internet Addresses Ports Sockets Name Resolution Firewalls Protocol Tunneling Proxy Servers Internet Standards Summary Web Basics Brief History of the Web Inside URLs Web Browsers Web Servers

VIM Contents Common Gateway Interface 36 Summary 37 Chapter 3 Beyond Web Basics 39 HTTP 39 MIME 54 HTML Forms 56 Summary 64 PART II Introduction to Servlets 67 Chapter 4 Why Servlets? 69 What Is a Servlet? 70 What Can Servlets Do? 74 Why Are Servlets Better Than CGI? 75 Summary 77 Chapter 5 Servlet Basics 79 Basic Servlet Structure 79 Servlet Lifecycle 81 Dissecting a Sample Servlet 82 Summary 91 Chapter 6 Servlet API Basics 93 HttpServlet Class 94 Cenen'cServl et Class 107 ServletRequest Interface 110 HttpServletRequest Interface 118 ServletResponse Interface 124 HttpServletResponse Interface 127 Summary 134 Chapter 7 WritingYour First Servlet 137 Servlet Requirements 137 Main Page 138 View Bulletins Page 145 Post Bulletin Page 152

Contents IX Save Bulletin Page 154 Complete Bulletin Board Servlet 159 Summary 166 Chapter 8 Running Servlets 167 JSDK Servlet Runner 167 Java Web Server 171 JRun 177 ServletExec 184 Summary 189 Chapter 9 Debugging Servlets 191 ServletDebug Class 191 Visual Cafe 198 JBuilder 201 Summary 206 Chapter 10 Beyond Servlet API Basics 209 ServletlnputStream Class 210 ServTetOutputStream Class 210 Se rvl etconf i g Interface 211 ServletContext Interface 213 ServletException Class 215 UnavailableExcepti on Class 216 Summary 217 PART III Advanced Servlet Concepts 219 Chapter 11 Writing Thread Safe Servlets 221 What Is Thread Safety? 221 Synchronization 224 se rvi ce (), doget (), and dopost () Local Variables 225 SingleThreadModel Interface 229 Summary 231 Chapter 12 HTTP Redirects 233 What Is an HTTP Redirect? 233

HTTP Header Syntax for a Redirect 234 Sending a Redirect with the Servlet API 235 Summary 237 Chapter 13 Cookies 239 What Is a Cookie? 239 HTTP Header Syntax for a Cookie 240 Setting Cookies with the Servlet API 243 Summary 248 Chapter 14 State and Session Management 249 What Is a Stateless Protocol? 249 What Is a Session? 250 State and Session Management Defined 253 State and Session Management Methods 254 Session Management with the Servlet API 264 Summary 276 Chapter 15 Server-Side Includes and Request Forwarding 279 Server-Side Includes 279 Using the RequestDi spatcher Object 283 Servlet Chaining 287 Summary 288 Chapter 16 Database Access with JDBC 291 JDBC Architecture 291 Accessing a Database 296 Sample JDBC Servlet 299 Summary 304 PART IV Sample Servlets 307 Chapter 17 Diagnostics Servlet 309 Chapter 18 Form Mailer Servlet 315 Chapter 19 File Upload Servlet 323

Contents XI PARTY Servlet API Quick Reference 335 Chapter 20 javax. servlet Package 337 Interface RequestDispatcher 338 Interface Se rvl et 339 Interface ServletConfig 340 Interface ServletContext 341 Interface ServletRequest 344 Interface ServletResponse 348 Interface Si nglethreadmodel 350 Class GenericServlet 351 Class ServletlnputStream 354 Class ServletOutputStream 355 Class ServletException 357 Class Unavai 1 abl eexcepti on 358 Chapter 21 j avax. servl et. http Package 361 Interface HttpServl etrequest 362 Interface HttpServletResponse 366 Interface HttpSessi on 374 Interface HttpSessionBi ndi nglistener 376 Class Cooki e 377 Class HttpServl et 381 Class HttpSessi onbi ndi ngevent 384 Class HttpUtiIs 385 PART VI Appendices 387 A Common Weil-Known Port Assignments 389 ß Java Port Scanner 390 C The Internet Standardization Process 392 D URL Syntax for Common Protocols 394 Meaning of URL Special Characters 396 F US-ASCII Encoding for Unsafe URL Characters 398

XII Contents G H Java HTTP Server HTTP Response Status Codes 399 405 1 Common HTTP Request Header Fields 408 J K L M BrowserRequest HTTP Viewer Common MIME Types printstacktraceo to String Servlet API Class Hierarchy Diagram 410 414 417 418 Index 421