Java Doc for FxResponseWrapper.java in  » J2EE » fleXive » com » flexive » war » filter » 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 » J2EE » fleXive » com.flexive.war.filter 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.servlet.http.HttpServletResponseWrapper
   com.flexive.war.filter.FxResponseWrapper

FxResponseWrapper
public class FxResponseWrapper extends HttpServletResponseWrapper (Code)
Response Wrapper to provide access to the content length and status.
author:
   Gregor Schober (gregor.schober@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
version:
   $Rev: 211 $

Inner Class :public static enum CacheControl

Field Summary
 booleancatchContent
    
 FxOutputStreamfos
    
 FxWriterfxWriter
    
 intlength
    
public  intlevel
    
 PrintWriterpw
    
 HttpServletResponseresp
    
 intstatus
    
 Stringstatus_msg
    

Constructor Summary
public  FxResponseWrapper(ServletResponse resp, boolean catchData)
     Constructor.

Method Summary
public  voidaddCookie(Cookie cookie)
     Adds the specified cookie to the response.
protected static  StringbuildModifiedAtDate(Date date)
     Returns the modified-at date for a http response with the given time.
public  booleancontainsHeader(String s)
     Returns a boolean indicating whether the named response header has already been set.
public  voiddisableBrowserCache()
     Force the browser to disable its cache.
public  voidenableBrowserCache(CacheControl ct, Integer maxAge, boolean mustRevalidate)
     Enables the browser cache.
public  voidflushBuffer()
     Flushes the buffers.
public  intgetBufferSize()
    
public  longgetContentLength()
     Get the content length delivered to the client (without headers).
public  longgetCreatedAt()
     Returns the time that this response object was created at.
public  byte[]getData()
     Returns the data sent to the client.
public  longgetId()
     Returns the unique responseWrapper id.
public  ServletOutputStreamgetOutputStream()
     Returns a ServletOutputStream suitable for writing binary data in the response.
public  ServletResponsegetResponse()
     Return the wrapped ServletResponse object.
public  intgetStatus()
     The http response status delivered to the client.
public  StringgetStatusMsg()
     The status message delivered to the client, may be null.
public  HttpServletResponsegetWrappedResponse()
     Returns the wrapped response.
public  PrintWritergetWriter()
     Returns a PrintWriter object that can send character text to the client.
public  booleanhadError()
     Returns true if generating the response has at least one error.
public  booleanisClientWriteThrough()
     Returns the setting of the ClientWriteThrough option.
public  booleanisCommitted()
     Returns true if the reponse was commited.
public  voidreset()
    
public  voidresetBuffer()
    
public  voidsendError(int i, String s)
     Sends a error to the client.
public  voidsendError(int i, Throwable t)
     Sends a error to the client.
public  voidsendError(int i)
     Sends a error to the client.
public  voidsendRedirect(String s)
    
public  voidsetBufferSize(int i)
    
public  voidsetContentLength(int i)
     Manual setter for the content length.
public  voidsetContentType(String s)
    
public  voidsetDateHeader(String s, long l)
    
public  voidsetHeader(String s, String s1)
    
public  voidsetModifiedAtDate(Date date)
     Sets the modified at date in the response to the given date.
public  voidsetResponse(ServletResponse servletResponse)
     Sets the wrapped ServletResponse object.
public  voidsetStatus(int i)
    
public  voidsetStatus(int i, String s)
    
public  voidsetXPoweredBy(String value)
     Sets the x powered by header.
public  voidwriteToUnderlyingResponse(String override)
     Writes the cached data to the underlying response, or the given string if the override parameter is set.

Field Detail
catchContent
boolean catchContent(Code)



fos
FxOutputStream fos(Code)



fxWriter
FxWriter fxWriter(Code)



length
int length(Code)



level
public int level(Code)



pw
PrintWriter pw(Code)



resp
HttpServletResponse resp(Code)



status
int status(Code)



status_msg
String status_msg(Code)




Constructor Detail
FxResponseWrapper
public FxResponseWrapper(ServletResponse resp, boolean catchData)(Code)
Constructor.
Parameters:
  resp - the original response object
Parameters:
  catchData - Has to be set to true if getData() is called later on.




Method Detail
addCookie
public void addCookie(Cookie cookie)(Code)
Adds the specified cookie to the response. This method can be called multiple times to set more than one cookie.
Parameters:
  cookie - the cookie to return to the client



buildModifiedAtDate
protected static String buildModifiedAtDate(Date date)(Code)
Returns the modified-at date for a http response with the given time.

This function uses the HTTP standard time format ("Sat, 07 Apr 2001 00:58:08 GMT")
Parameters:
  date - the date to use the modified-at date with the current time




containsHeader
public boolean containsHeader(String s)(Code)
Returns a boolean indicating whether the named response header has already been set.
Parameters:
  s - the header name a boolean indicating whether the named response header has already been set



disableBrowserCache
public void disableBrowserCache()(Code)
Force the browser to disable its cache.

Ths functions sets the expires, cache control and pragma="no cache" headers




enableBrowserCache
public void enableBrowserCache(CacheControl ct, Integer maxAge, boolean mustRevalidate)(Code)
Enables the browser cache.
Parameters:
  ct - the type, CacheControl.PUBLIC or CacheControl.PRIVATE
Parameters:
  maxAge - in seconds, use null if you dont want this to be set - specifies the maximum amount oftime that an object will be considered fresh.Similar to Expires, this directive allows more flexibility.[seconds] is the number of seconds from the time of the request you wish the object to be fresh for.
Parameters:
  mustRevalidate - tells caches that they must obey any freshness information you give them about an object.The HTTP allows caches to take liberties with the freshness of objects; by specifying this header, you'retelling the cache that you want it to strictly follow your rules.



flushBuffer
public void flushBuffer() throws IOException(Code)
Flushes the buffers.
throws:
  IOException -



getBufferSize
public int getBufferSize()(Code)



getContentLength
public long getContentLength()(Code)
Get the content length delivered to the client (without headers). the content length delivered to the client



getCreatedAt
public long getCreatedAt()(Code)
Returns the time that this response object was created at. the time that this response object was created at



getData
public byte[] getData()(Code)
Returns the data sent to the client.

The option catchContent has to be set to true in the constructor, or a empty byte array is returned. the data sent to the client.




getId
public long getId()(Code)
Returns the unique responseWrapper id.

IDs are reused when MAX_LONGVALUE is reached. the unique responseWrapper id




getOutputStream
public ServletOutputStream getOutputStream() throws IOException(Code)
Returns a ServletOutputStream suitable for writing binary data in the response. the output stream
throws:
  IOException -



getResponse
public ServletResponse getResponse()(Code)
Return the wrapped ServletResponse object. the wrapped response object



getStatus
public int getStatus()(Code)
The http response status delivered to the client. The http response status delivered to the client



getStatusMsg
public String getStatusMsg()(Code)
The status message delivered to the client, may be null. the status message delivered to the client



getWrappedResponse
public HttpServletResponse getWrappedResponse()(Code)
Returns the wrapped response. the wrapped response



getWriter
public PrintWriter getWriter() throws IOException(Code)
Returns a PrintWriter object that can send character text to the client. the writer
throws:
  IOException -



hadError
public boolean hadError()(Code)
Returns true if generating the response has at least one error. true if generating the response has at least one error



isClientWriteThrough
public boolean isClientWriteThrough()(Code)
Returns the setting of the ClientWriteThrough option. the setting of the ClientWriteThrough option.



isCommitted
public boolean isCommitted()(Code)
Returns true if the reponse was commited. true if the reponse was commited



reset
public void reset()(Code)



resetBuffer
public void resetBuffer()(Code)



sendError
public void sendError(int i, String s) throws IOException(Code)
Sends a error to the client.
Parameters:
  i - the error code
Parameters:
  s - the error message
throws:
  IOException - if a io exception occured



sendError
public void sendError(int i, Throwable t) throws IOException(Code)
Sends a error to the client.
Parameters:
  i - the error code
Parameters:
  t - the error
throws:
  IOException - if a io exception occured



sendError
public void sendError(int i) throws IOException(Code)
Sends a error to the client.
Parameters:
  i - the error code
throws:
  IOException - if a exception occurs



sendRedirect
public void sendRedirect(String s) throws IOException(Code)



setBufferSize
public void setBufferSize(int i)(Code)



setContentLength
public void setContentLength(int i)(Code)
Manual setter for the content length.
Parameters:
  i - the length



setContentType
public void setContentType(String s)(Code)



setDateHeader
public void setDateHeader(String s, long l)(Code)



setHeader
public void setHeader(String s, String s1)(Code)



setModifiedAtDate
public void setModifiedAtDate(Date date)(Code)
Sets the modified at date in the response to the given date.
Parameters:
  date - the date to use



setResponse
public void setResponse(ServletResponse servletResponse)(Code)
Sets the wrapped ServletResponse object.
Parameters:
  servletResponse - the wrapped response



setStatus
public void setStatus(int i)(Code)
Sets the status code for this response
Parameters:
  i - the status



setStatus
public void setStatus(int i, String s)(Code)
Sets the status code for this response
Parameters:
  i - the status
Parameters:
  s - the status message



setXPoweredBy
public void setXPoweredBy(String value)(Code)
Sets the x powered by header.
Parameters:
  value - the value



writeToUnderlyingResponse
public void writeToUnderlyingResponse(String override) throws IOException, FxApplicationException(Code)
Writes the cached data to the underlying response, or the given string if the override parameter is set.

This function may only be called if ClientWriteThrough was not set to true at creation time.
Parameters:
  override - overrides the data if set
throws:
  IOException - if an io exception occured
throws:
  FxApplicationException - if an exception occured




Methods inherited from javax.servlet.http.HttpServletResponseWrapper
public void addCookie(Cookie cookie)(Code)(Java Doc)
public void addDateHeader(String name, long date)(Code)(Java Doc)
public void addHeader(String name, String value)(Code)(Java Doc)
public void addIntHeader(String name, int value)(Code)(Java Doc)
public boolean containsHeader(String name)(Code)(Java Doc)
public String encodeRedirectURL(String url)(Code)(Java Doc)
public String encodeRedirectUrl(String url)(Code)(Java Doc)
public String encodeURL(String url)(Code)(Java Doc)
public String encodeUrl(String url)(Code)(Java Doc)
public void sendError(int sc, String msg) throws IOException(Code)(Java Doc)
public void sendError(int sc) throws IOException(Code)(Java Doc)
public void sendRedirect(String location) throws IOException(Code)(Java Doc)
public void setDateHeader(String name, long date)(Code)(Java Doc)
public void setHeader(String name, String value)(Code)(Java Doc)
public void setIntHeader(String name, int value)(Code)(Java Doc)
public void setStatus(int sc)(Code)(Java Doc)
public void setStatus(int sc, String sm)(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.