| < Free Open Study > |
|
We have examined the Hypertext Transfer Protocol in some detail, including the protocol layers HTTP sits upon to function. We examined how state and connections are managed, and looked at security and authentication in the protocol. The HTTP 1.0 and now the 1.1 standard is evolving with varying levels of implementation and support.
This chapter explained how to use HTTP requests and responses with servlets, namely with javax.servlet.http.HttpServlet. We focused upon the HTTP 1.0-based methods such as doGet(), doPost() and doHead(), and followed this by discussing the less frequently-used methods relating to HTTP 1.1 too: doDelete(), doPut(), doOptions() and doTrace().
The javax.servlet.http.HttpServletRequest interface provides access to the clients' request information, including headers, attributes, paths, authentication, sessions, cookies, and internationalization. Similarly the javax.servlet.http.HttpServletResponse interface allows us access to the server's response, including methods assessing headers, redirection, status codes and errors, cookies, session management, internationalization and buffering. Finally the HttpServletRequestWrapper and the HttpServletResponseWrapper allow developers to extend the functionality of these request and response interfaces.
We concluded the chapter by developing an HTTP-based client-servlet application. This demonstrated some of the techniques involved in HTTP communications to and from a servlet. In this case we looked at a servlet processing a Java application's requests, received over HTTP. We considered the extensible design of the server classes, including the servlet, the handler classes, and the handler factory class we constructed.
In the following chapter we will discuss the deployment of web applications.
A |
---|
accept() method, FileExchangeFilter class
addDateHeader() method, HttpServletResponse interface
addHeader() method, HttpServletResponse interface
addIntHeader() method, HttpServletResponse interface
appendMessage() method, FileExchangeView class
application layer protocols, 1 authentication
|
B |
---|
Base 64 encoding
BaseRequest class
Basic Access Authentication, HTTP
|
C |
---|
classes
cleanFileList() method, FileValidator class
client GUI
client implementation
containsHeader() method, HttpServletResponse interface
cookies
custom clients
|
D |
---|
DELETE method, HTTP, 3
delete() method, DeleteHandler class
DeleteHandler class
deleteRequest() method, FileExchangeModel class
destroy() method, HttpServlet class
Digest Access Authentication, 6 doGet() method
doGet() method, FileExchangeServlet class
doHead() method, HttpServlet class
doPost() method
doPost() method, FileExchangeServlet class
doQuestion() method
doTrace method, HttpServlet class
DownloadHandler class
downloadRequest() method, FileExchangeModel class
|
E |
---|
encodeRedirectURL() method,
Entity headers, HTTP
errors, HTTP
|
F |
---|
Factory pattern
FileExchangeApplication class
FileExchangeFilter class
FileExchangeModel class
FileExchangeModel object
FileExchangeServlet class
FileExchangeView class
FileExchangeView object
FileFilter abstract class
FileList class
FileName class
FileValidator class
firewall subdirectories
firewall.client package
firewall.common package
firewall.server package
flush() method, FileExchangeModel class
|
G |
---|
General headers, HTTP
GET method, HTTP, 3
GET request type
getAuthType() method, HttpServletRequest interface
getContextPath() method, HttpServletRequest interface
getDateHeader() method, HttpServletRequest interface
getDescription() method, FileExchangeFilter class
getExtension() method, FileExchangeFilter class
getFile() method, RequestHandler class
getFileList() method, RequestHandler class
getHandler() method, RequestHandlerFactory class
getHeader() method, HttpServletRequest interface
getHeaderNames() method, HttpServletRequest interface
getHeaders() method, HttpServletRequest interface
getHttpRequestTable() method
getHttpResponseTable() method
getHttpURLConnection() method,
getInstance() method, HTTP
getIntHeader() method, HttpServletRequest interface
getLastModified method, HttpServlet class
getMethod() method, HttpServletRequest interface
getPathInfo() method, HttpServletRequest interface
getPathTranslated() method, HttpServletRequest interface
getQueryString() method, HttpServletRequest interface
getRemoteUser() method, HttpServletRequest interface
getRequestHandlerFactory() method,
getRequestType() method, FileExchangeServlet class
getRequestURI() method, HttpServletRequest interface
getRequestURL() method, HttpServletRequest interface
getServletPath() method, HttpServletRequest interface
getUserPrincipal() method, HttpServletRequest interface
|
H |
---|
HEAD method, HTTP, 3 headers
HTMLTable utility class
HTTP (Hypertext Transfer Protocol)
HTTP based client-servlet application, 26-58
HTTP Basic Access Authentication
HTTP headers
HTTP methods
HTTP servlets, 1
HttpRequestResponseServlet class
HttpServlet class, javax.servlet.http, 7
HttpServletRequest interface, javax.servlet.http, 10
HttpServletResponse class, javax.servlet.http
HttpServletResponse interface, javax.servlet.http, 14
|
I |
---|
init() method, FileExchangeServlet class
init() method, HttpServlet class
init() method, RequestHandler class
InputStreamReader
instantiateHandler() method, RequestHandler class
interfaces
isCommitted() method, HttpServletResponse interface
isFileNameValid() method, FileValidator class
|
J |
---|
javax.servlet package
javax.servlet.http package
JFileChooser, javax.swing
JList, javax.swing
JTextArea, javax.swing
|
M |
---|
main() method, FileExchangeApplication class
methods
MIME (Multipurpose Internet Mail Extensions) types
MIME types
|
O |
---|
OPTIONS method
|
P |
---|
packages
paths
patterns
POST method, HTTP, 3
POST request type
protocols
PUT method, HTTP, 3 |
Q |
---|
QuizServlet
|
R |
---|
readResponse() method, FileExchangeModel class
readSerializedObject() method,
refreshFileList() method, FileExchangeView class
RefreshHandler class
refreshRequest() method, FileExchangeModel class
Request headers, HTTP
RequestDispatcher object
RequestHandler class
RequestHandlerFactory class
requests
respond() method, FileExchangeServlet class
respond() method, RequestHandler class
Response headers, HTTP
responses
RFC 2045 and 2046, MIME, 15 |
S |
---|
sendError() method, HttpServletResponse interface
sendError() method, RequestHandler class
sendFile() method, RequestHandler class
sendRedirect() method, HttpServletResponse interface
sendRequest() method, FileExchangeModel class
sendSerializedObject() method, RequestHandler class
service() method, HttpServlet class
servlets
setContentLength() method,
setContentType() method, HttpServletResponse interface
setDateHeader() method, HttpServletResponse interface
setDoOutput() method, FileExchangeModel class
setHeader() method, HttpServletResponse interface
setHttpObjects() method
setHttpObjects() method, RequestHandler class
setIntHeader() method, HttpServletResponse interface
setStatus() method, HttpServletResponse interface
setStatusCode() method, RequestHandler class
setStringFileBase() method, RequestHandler class
setUseCaches() method, FileExchangeModel class
Singleton pattern
SSL (Secure Sockets Layer)
status codes, HTTP, 4
|
T |
---|
TRACE method
|
U |
---|
UploadHandler class
uploadRequest() method, FileExchangeModel class
|
W |
---|
web applications
|
| < Free Open Study > |
|