Java Doc for DefaultServlet.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » catalina » servlets » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Sevlet Container » apache tomcat 6.0.14 » org.apache.catalina.servlets 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.servlet.http.HttpServlet
   org.apache.catalina.servlets.DefaultServlet

All known Subclasses:   org.apache.catalina.servlets.WebdavServlet,
DefaultServlet
public class DefaultServlet extends HttpServlet (Code)
The default resource-serving servlet for most web applications, used to serve static resources such as HTML pages and images.
author:
   Craig R. McClanahan
author:
   Remy Maucherat
version:
   $Revision: 543680 $ $Date: 2007-06-02 02:42:36 +0200 (sam., 02 juin 2007) $

Inner Class :protected class Range

Field Summary
final protected static  intBUFFER_SIZE
     Size of file transfer buffer in bytes.
protected static  ArrayListFULL
     Full range marker.
final protected static  StringRESOURCES_JNDI_NAME
     JNDI resources name.
protected  intdebug
     The debugging detail level for this servlet.
protected  StringfileEncoding
     File encoding to be used when reading static files.
protected  StringglobalXsltFile
     Allow customized directory listing per instance.
protected  intinput
     The input buffer size to use when serving resources.
protected  booleanlistings
    
protected  StringlocalXsltFile
     Allow customized directory listing per directory.
final protected static  StringmimeSeparation
    
protected  intoutput
     The output buffer size to use when serving resources.
protected  booleanreadOnly
     Read only flag.
protected  StringreadmeFile
     Allow a readme file to be included.
protected  ProxyDirContextresources
     Proxy directory context.
protected  intsendfileSize
     Minimum size for sendfile usage in bytes.
protected static  StringManagersm
     The string manager for this package.
protected static  URLEncoderurlEncoder
     Array containing the safe characters set.


Method Summary
protected  booleancheckIfHeaders(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes)
     Check if the conditions specified in the optional If headers are satisfied.
protected  booleancheckIfMatch(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes)
     Check if the if-match condition is satisfied.
protected  booleancheckIfModifiedSince(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes)
     Check if the if-modified-since condition is satisfied.
protected  booleancheckIfNoneMatch(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes)
     Check if the if-none-match condition is satisfied.
protected  booleancheckIfUnmodifiedSince(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes)
     Check if the if-unmodified-since condition is satisfied.
protected  booleancheckSendfile(HttpServletRequest request, HttpServletResponse response, CacheEntry entry, long length, Range range)
     Check if sendfile can be used.
protected  voidcopy(CacheEntry cacheEntry, InputStream is, ServletOutputStream ostream)
     Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
protected  voidcopy(CacheEntry cacheEntry, InputStream is, PrintWriter writer)
     Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
protected  voidcopy(CacheEntry cacheEntry, ServletOutputStream ostream, Range range)
     Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
protected  voidcopy(CacheEntry cacheEntry, PrintWriter writer, Range range)
     Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
protected  voidcopy(CacheEntry cacheEntry, ServletOutputStream ostream, Iterator ranges, String contentType)
     Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
protected  voidcopy(CacheEntry cacheEntry, PrintWriter writer, Iterator ranges, String contentType)
     Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
protected  IOExceptioncopyRange(InputStream istream, ServletOutputStream ostream)
     Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
protected  IOExceptioncopyRange(Reader reader, PrintWriter writer)
     Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
protected  IOExceptioncopyRange(InputStream istream, ServletOutputStream ostream, long start, long end)
     Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
protected  IOExceptioncopyRange(Reader reader, PrintWriter writer, long start, long end)
     Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
public  voiddestroy()
     Finalize this servlet.
protected  voiddisplaySize(StringBuffer buf, int filesize)
     Display the size of a file.
protected  voiddoDelete(HttpServletRequest req, HttpServletResponse resp)
     Process a POST request for the specified resource.
protected  voiddoGet(HttpServletRequest request, HttpServletResponse response)
     Process a GET request for the specified resource.
protected  voiddoHead(HttpServletRequest request, HttpServletResponse response)
     Process a HEAD request for the specified resource.
protected  voiddoPost(HttpServletRequest request, HttpServletResponse response)
     Process a POST request for the specified resource.
protected  voiddoPut(HttpServletRequest req, HttpServletResponse resp)
     Process a POST request for the specified resource.
protected  FileexecutePartialPut(HttpServletRequest req, Range range, String path)
     Handle a partial PUT.
protected  InputStreamfindXsltInputStream(DirContext directory)
    
protected  StringgetETag(ResourceAttributes resourceAttributes)
     Get the ETag associated with a file.
protected  StringgetReadme(DirContext directory)
     Get the readme file as a string.
protected  StringgetRelativePath(HttpServletRequest request)
     Return the relative path associated with this servlet.
public  voidinit()
     Initialize this servlet.
protected  RangeparseContentRange(HttpServletRequest request, HttpServletResponse response)
     Parse the content-range header.
protected  ArrayListparseRange(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes)
     Parse the range header.
protected  InputStreamrender(String contextPath, CacheEntry cacheEntry)
     Decide which way to render.
protected  InputStreamrenderHtml(String contextPath, CacheEntry cacheEntry)
     Return an InputStream to an HTML representation of the contents of this directory.
protected  StringrenderSize(long size)
     Render the specified file size (in bytes).
protected  InputStreamrenderXml(String contextPath, CacheEntry cacheEntry, InputStream xsltInputStream)
     Return an InputStream to an HTML representation of the contents of this directory.
protected  StringrewriteUrl(String path)
     URL rewriter.
protected  voidserveResource(HttpServletRequest request, HttpServletResponse response, boolean content)
     Serve the specified resource, optionally including the data content.

Field Detail
BUFFER_SIZE
final protected static int BUFFER_SIZE(Code)
Size of file transfer buffer in bytes.



FULL
protected static ArrayList FULL(Code)
Full range marker.



RESOURCES_JNDI_NAME
final protected static String RESOURCES_JNDI_NAME(Code)
JNDI resources name.



debug
protected int debug(Code)
The debugging detail level for this servlet.



fileEncoding
protected String fileEncoding(Code)
File encoding to be used when reading static files. If none is specified the platform default is used.



globalXsltFile
protected String globalXsltFile(Code)
Allow customized directory listing per instance.



input
protected int input(Code)
The input buffer size to use when serving resources.



listings
protected boolean listings(Code)
Should we generate directory listings?



localXsltFile
protected String localXsltFile(Code)
Allow customized directory listing per directory.



mimeSeparation
final protected static String mimeSeparation(Code)
MIME multipart separation string



output
protected int output(Code)
The output buffer size to use when serving resources.



readOnly
protected boolean readOnly(Code)
Read only flag. By default, it's set to true.



readmeFile
protected String readmeFile(Code)
Allow a readme file to be included.



resources
protected ProxyDirContext resources(Code)
Proxy directory context.



sendfileSize
protected int sendfileSize(Code)
Minimum size for sendfile usage in bytes.



sm
protected static StringManager sm(Code)
The string manager for this package.



urlEncoder
protected static URLEncoder urlEncoder(Code)
Array containing the safe characters set.





Method Detail
checkIfHeaders
protected boolean checkIfHeaders(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes) throws IOException(Code)
Check if the conditions specified in the optional If headers are satisfied.
Parameters:
  request - The servlet request we are processing
Parameters:
  response - The servlet response we are creating
Parameters:
  resourceAttributes - The resource information boolean true if the resource meets all the specified conditions,and false if any of the conditions is not satisfied, in which caserequest processing is stopped



checkIfMatch
protected boolean checkIfMatch(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes) throws IOException(Code)
Check if the if-match condition is satisfied.
Parameters:
  request - The servlet request we are processing
Parameters:
  response - The servlet response we are creating
Parameters:
  resourceInfo - File object boolean true if the resource meets the specified condition,and false if the condition is not satisfied, in which case requestprocessing is stopped



checkIfModifiedSince
protected boolean checkIfModifiedSince(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes) throws IOException(Code)
Check if the if-modified-since condition is satisfied.
Parameters:
  request - The servlet request we are processing
Parameters:
  response - The servlet response we are creating
Parameters:
  resourceInfo - File object boolean true if the resource meets the specified condition,and false if the condition is not satisfied, in which case requestprocessing is stopped



checkIfNoneMatch
protected boolean checkIfNoneMatch(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes) throws IOException(Code)
Check if the if-none-match condition is satisfied.
Parameters:
  request - The servlet request we are processing
Parameters:
  response - The servlet response we are creating
Parameters:
  resourceInfo - File object boolean true if the resource meets the specified condition,and false if the condition is not satisfied, in which case requestprocessing is stopped



checkIfUnmodifiedSince
protected boolean checkIfUnmodifiedSince(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes) throws IOException(Code)
Check if the if-unmodified-since condition is satisfied.
Parameters:
  request - The servlet request we are processing
Parameters:
  response - The servlet response we are creating
Parameters:
  resourceInfo - File object boolean true if the resource meets the specified condition,and false if the condition is not satisfied, in which case requestprocessing is stopped



checkSendfile
protected boolean checkSendfile(HttpServletRequest request, HttpServletResponse response, CacheEntry entry, long length, Range range)(Code)
Check if sendfile can be used.



copy
protected void copy(CacheEntry cacheEntry, InputStream is, ServletOutputStream ostream) throws IOException(Code)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
Parameters:
  resourceInfo - The resource information
Parameters:
  ostream - The output stream to write to
exception:
  IOException - if an input/output error occurs



copy
protected void copy(CacheEntry cacheEntry, InputStream is, PrintWriter writer) throws IOException(Code)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
Parameters:
  resourceInfo - The resource info
Parameters:
  writer - The writer to write to
exception:
  IOException - if an input/output error occurs



copy
protected void copy(CacheEntry cacheEntry, ServletOutputStream ostream, Range range) throws IOException(Code)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
Parameters:
  resourceInfo - The ResourceInfo object
Parameters:
  ostream - The output stream to write to
Parameters:
  range - Range the client wanted to retrieve
exception:
  IOException - if an input/output error occurs



copy
protected void copy(CacheEntry cacheEntry, PrintWriter writer, Range range) throws IOException(Code)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
Parameters:
  resourceInfo - The ResourceInfo object
Parameters:
  writer - The writer to write to
Parameters:
  range - Range the client wanted to retrieve
exception:
  IOException - if an input/output error occurs



copy
protected void copy(CacheEntry cacheEntry, ServletOutputStream ostream, Iterator ranges, String contentType) throws IOException(Code)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
Parameters:
  resourceInfo - The ResourceInfo object
Parameters:
  ostream - The output stream to write to
Parameters:
  ranges - Enumeration of the ranges the client wanted to retrieve
Parameters:
  contentType - Content type of the resource
exception:
  IOException - if an input/output error occurs



copy
protected void copy(CacheEntry cacheEntry, PrintWriter writer, Iterator ranges, String contentType) throws IOException(Code)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
Parameters:
  resourceInfo - The ResourceInfo object
Parameters:
  writer - The writer to write to
Parameters:
  ranges - Enumeration of the ranges the client wanted to retrieve
Parameters:
  contentType - Content type of the resource
exception:
  IOException - if an input/output error occurs



copyRange
protected IOException copyRange(InputStream istream, ServletOutputStream ostream)(Code)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
Parameters:
  istream - The input stream to read from
Parameters:
  ostream - The output stream to write to Exception which occurred during processing



copyRange
protected IOException copyRange(Reader reader, PrintWriter writer)(Code)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
Parameters:
  reader - The reader to read from
Parameters:
  writer - The writer to write to Exception which occurred during processing



copyRange
protected IOException copyRange(InputStream istream, ServletOutputStream ostream, long start, long end)(Code)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
Parameters:
  istream - The input stream to read from
Parameters:
  ostream - The output stream to write to
Parameters:
  start - Start of the range which will be copied
Parameters:
  end - End of the range which will be copied Exception which occurred during processing



copyRange
protected IOException copyRange(Reader reader, PrintWriter writer, long start, long end)(Code)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception).
Parameters:
  reader - The reader to read from
Parameters:
  writer - The writer to write to
Parameters:
  start - Start of the range which will be copied
Parameters:
  end - End of the range which will be copied Exception which occurred during processing



destroy
public void destroy()(Code)
Finalize this servlet.



displaySize
protected void displaySize(StringBuffer buf, int filesize)(Code)
Display the size of a file.



doDelete
protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)
Process a POST request for the specified resource.
Parameters:
  req - The servlet request we are processing
Parameters:
  resp - The servlet response we are creating
exception:
  IOException - if an input/output error occurs
exception:
  ServletException - if a servlet-specified error occurs



doGet
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException(Code)
Process a GET request for the specified resource.
Parameters:
  request - The servlet request we are processing
Parameters:
  response - The servlet response we are creating
exception:
  IOException - if an input/output error occurs
exception:
  ServletException - if a servlet-specified error occurs



doHead
protected void doHead(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException(Code)
Process a HEAD request for the specified resource.
Parameters:
  request - The servlet request we are processing
Parameters:
  response - The servlet response we are creating
exception:
  IOException - if an input/output error occurs
exception:
  ServletException - if a servlet-specified error occurs



doPost
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException(Code)
Process a POST request for the specified resource.
Parameters:
  request - The servlet request we are processing
Parameters:
  response - The servlet response we are creating
exception:
  IOException - if an input/output error occurs
exception:
  ServletException - if a servlet-specified error occurs



doPut
protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)
Process a POST request for the specified resource.
Parameters:
  req - The servlet request we are processing
Parameters:
  resp - The servlet response we are creating
exception:
  IOException - if an input/output error occurs
exception:
  ServletException - if a servlet-specified error occurs



executePartialPut
protected File executePartialPut(HttpServletRequest req, Range range, String path) throws IOException(Code)
Handle a partial PUT. New content specified in request is appended to existing content in oldRevisionContent (if present). This code does not support simultaneous partial updates to the same resource.



findXsltInputStream
protected InputStream findXsltInputStream(DirContext directory) throws IOException, ServletException(Code)
Return the xsl template inputstream (if possible)



getETag
protected String getETag(ResourceAttributes resourceAttributes)(Code)
Get the ETag associated with a file.
Parameters:
  resourceAttributes - The resource information



getReadme
protected String getReadme(DirContext directory) throws IOException, ServletException(Code)
Get the readme file as a string.



getRelativePath
protected String getRelativePath(HttpServletRequest request)(Code)
Return the relative path associated with this servlet.
Parameters:
  request - The servlet request we are processing



init
public void init() throws ServletException(Code)
Initialize this servlet.



parseContentRange
protected Range parseContentRange(HttpServletRequest request, HttpServletResponse response) throws IOException(Code)
Parse the content-range header.
Parameters:
  request - The servlet request we are processing
Parameters:
  response - The servlet response we are creating Range



parseRange
protected ArrayList parseRange(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes) throws IOException(Code)
Parse the range header.
Parameters:
  request - The servlet request we are processing
Parameters:
  response - The servlet response we are creating Vector of ranges



render
protected InputStream render(String contextPath, CacheEntry cacheEntry) throws IOException, ServletException(Code)
Decide which way to render. HTML or XML.



renderHtml
protected InputStream renderHtml(String contextPath, CacheEntry cacheEntry) throws IOException, ServletException(Code)
Return an InputStream to an HTML representation of the contents of this directory.
Parameters:
  contextPath - Context path to which our internal paths arerelative



renderSize
protected String renderSize(long size)(Code)
Render the specified file size (in bytes).
Parameters:
  size - File size (in bytes)



renderXml
protected InputStream renderXml(String contextPath, CacheEntry cacheEntry, InputStream xsltInputStream) throws IOException, ServletException(Code)
Return an InputStream to an HTML representation of the contents of this directory.
Parameters:
  contextPath - Context path to which our internal paths arerelative



rewriteUrl
protected String rewriteUrl(String path)(Code)
URL rewriter.
Parameters:
  path - Path which has to be rewiten



serveResource
protected void serveResource(HttpServletRequest request, HttpServletResponse response, boolean content) throws IOException, ServletException(Code)
Serve the specified resource, optionally including the data content.
Parameters:
  request - The servlet request we are processing
Parameters:
  response - The servlet response we are creating
Parameters:
  content - Should the content be included?
exception:
  IOException - if an input/output error occurs
exception:
  ServletException - if a servlet-specified error occurs



Methods inherited from javax.servlet.http.HttpServlet
protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected long getLastModified(HttpServletRequest req)(Code)(Java Doc)
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.