Java Doc for RimfaxeHttpServletResponse.java in  » Web-Server » Rimfaxe-Web-Server » com » rimfaxe » webserver » servletapi » 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 » Web Server » Rimfaxe Web Server » com.rimfaxe.webserver.servletapi 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.rimfaxe.webserver.servletapi.RimfaxeHttpServletResponse

RimfaxeHttpServletResponse
public class RimfaxeHttpServletResponse implements HttpServletResponse(Code)


Field Summary
final public static  StringCHARSET_PARAMETER
    
final public static  intDEFAULT_BUFFER_SIZE
    
final public static  StringINCLUDED
    
final public static  intMIN_BUFFER_SIZE
    
final public static  StringMONITOR
    
final public static  StringSTREAM
    
protected  intbuffer_size
    
 Stringcontent_type
    
 Hashtableheaders
    
protected  RimfaxeHttpServletRequestjrequest
    
protected  Localelocale
    
 httpRequestrequest
    
 VectorsetCookies
    
 intstate
    
 intstatus
    
 WebContextwebcontext
    

Constructor Summary
 RimfaxeHttpServletResponse(httpRequest request, WebContext webcontext)
    

Method Summary
public  voidaddCookie(Cookie cookie)
     Adds the specified cookie to the response.
public  voidaddDateHeader(String name, long date)
    
public  voidaddHeader(String name, String value)
    
public  voidaddIntHeader(String name, int value)
    
public  booleancontainsHeader(String header)
     Checks whether the response message header has a field with the specified name.
public  StringencodeRedirectURL(String url)
     Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed, returns the URL unchanged.
public  StringencodeRedirectUrl(String url)
     Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed, returns the URL unchanged.
public  StringencodeURL(String url)
     Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.
public  StringencodeUrl(String url)
     Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged.
public  voidflushBuffer()
     Forces any content in the buffer to be written to the client.
protected synchronized  voidflushStream(boolean close)
     Flush the output stream.
public  intgetBufferSize()
     Returns the actual buffer size used for the response.
public  StringgetCharacterEncoding()
    
public  LocalegetLocale()
     Returns the locale assigned to the response.
public synchronized  ServletOutputStreamgetOutputStream()
    
protected  ServletOutputStreamgetRimfaxeOutputStream(boolean writerUsed)
    
public  SedaHttpResponsegetSedaResponse()
    
public synchronized  java.io.PrintWritergetWriter()
     Returns a print writer for writing formatted text responses.
public  booleanisCommitted()
     Returns a boolean indicating if the response has been committed.
protected  booleanisStreamObtained()
    
public  voidreset()
     Clears any data that exists in the buffer as well as the status code and headers.
public  voidresetBuffer()
    
public  voidsendError(int i, String msg)
     Sends an error response to the client using the specified status code and descriptive message.
public  voidsendError(int i)
     Sends an error response to the client using the specified status code and a default message.
public  voidsendRedirect(String url)
     Sends a temporary redirect response to the client using the specified redirect location URL.
public  voidsetBufferSize(int size)
     Sets the preferred buffer size for the body of the response.
public  voidsetContentLength(int i)
     Sets the content length for this response.
public  voidsetContentType(String spec)
    
public  voidsetDateHeader(String name, long date)
     Adds a field to the response header with the given name and date-valued field.
public  voidsetHeader(String name, String value)
     Adds a field to the response header with the given name and value.
public  voidsetIntHeader(String name, int value)
     Adds a field to the response header with the given name and integer value.
public  voidsetLocale(Locale locale)
     Sets the locale of the response, setting the headers (including the Content-Type's charset) as appropriate.
protected  voidsetServletRequest(RimfaxeHttpServletRequest jrequest)
    
public  voidsetStatus(int i, String reason)
     Sets the status code and message for this response.
public  voidsetStatus(int i)
     Sets the status code for this response.
public  voidunsetHeader(String name)
    

Field Detail
CHARSET_PARAMETER
final public static String CHARSET_PARAMETER(Code)



DEFAULT_BUFFER_SIZE
final public static int DEFAULT_BUFFER_SIZE(Code)



INCLUDED
final public static String INCLUDED(Code)



MIN_BUFFER_SIZE
final public static int MIN_BUFFER_SIZE(Code)



MONITOR
final public static String MONITOR(Code)



STREAM
final public static String STREAM(Code)



buffer_size
protected int buffer_size(Code)



content_type
String content_type(Code)



headers
Hashtable headers(Code)



jrequest
protected RimfaxeHttpServletRequest jrequest(Code)



locale
protected Locale locale(Code)



request
httpRequest request(Code)



setCookies
Vector setCookies(Code)



state
int state(Code)



status
int status(Code)



webcontext
WebContext webcontext(Code)




Constructor Detail
RimfaxeHttpServletResponse
RimfaxeHttpServletResponse(httpRequest request, WebContext webcontext)(Code)




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



addDateHeader
public void addDateHeader(String name, long date)(Code)



addHeader
public void addHeader(String name, String value)(Code)



addIntHeader
public void addIntHeader(String name, int value)(Code)



containsHeader
public boolean containsHeader(String header)(Code)
Checks whether the response message header has a field with the specified name.
Parameters:
  name - - the header field name true if the response message header has a field with the specified name; false otherwise



encodeRedirectURL
public String encodeRedirectURL(String url)(Code)
Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed, returns the URL unchanged. The implementation of this method should include the logic to determine whether the session ID needs to be encoded in the URL. Because the rules for making this determination differ from those used to decide whether to encode a normal link, this method is seperate from the encodeUrl method.

All URLs sent to the HttpServletResponse.sendRedirect method should be run through this method. Otherwise, URL rewriting canont be used with browsers which do not support cookies.
Parameters:
  url - - the url to be encoded. the encoded URL if encoding is needed; the unchanged URL otherwise.




encodeRedirectUrl
public String encodeRedirectUrl(String url)(Code)
Encodes the specified URL for use in the sendRedirect method or, if encoding is not needed, returns the URL unchanged. The implementation of this method should include the logic to determine whether the session ID needs to be encoded in the URL. Because the rules for making this determination differ from those used to decide whether to encode a normal link, this method is seperate from the encodeUrl method.

All URLs sent to the HttpServletResponse.sendRedirect method should be run through this method. Otherwise, URL rewriting canont be used with browsers which do not support cookies.
Parameters:
  url - - the url to be encoded. the encoded URL if encoding is needed; the unchanged URL otherwise.




encodeURL
public String encodeURL(String url)(Code)
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged. The implementation of this method should include the logic to determine whether the session ID needs to be encoded in the URL. For example, if the browser supports cookies, or session tracking is turned off, URL encoding is unnecessary.

All URLs emitted by a Servlet should be run through this method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.
Parameters:
  url - - the url to be encoded. the encoded URL if encoding is needed; the unchanged URL otherwise.




encodeUrl
public String encodeUrl(String url)(Code)
Encodes the specified URL by including the session ID in it, or, if encoding is not needed, returns the URL unchanged. The implementation of this method should include the logic to determine whether the session ID needs to be encoded in the URL. For example, if the browser supports cookies, or session tracking is turned off, URL encoding is unnecessary.

All URLs emitted by a Servlet should be run through this method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.
Parameters:
  url - - the url to be encoded. the encoded URL if encoding is needed; the unchanged URL otherwise.




flushBuffer
public void flushBuffer() throws IOException(Code)
Forces any content in the buffer to be written to the client. A call to this method automatically commits the response, meaning the status code and headers will be written.
See Also:   RimfaxeHttpServletResponse.setBufferSize
See Also:   RimfaxeHttpServletResponse.getBufferSize
See Also:   RimfaxeHttpServletResponse.isCommitted
See Also:   RimfaxeHttpServletResponse.reset



flushStream
protected synchronized void flushStream(boolean close) throws IOException(Code)
Flush the output stream.
Parameters:
  close - Close the stream if true.
exception:
  IOException - if an IO error occurs.



getBufferSize
public int getBufferSize()(Code)
Returns the actual buffer size used for the response. If no buffering is used, this method returns 0. the actual buffer size used
See Also:   RimfaxeHttpServletResponse.setBufferSize
See Also:   RimfaxeHttpServletResponse.flushBuffer
See Also:   RimfaxeHttpServletResponse.isCommitted
See Also:   RimfaxeHttpServletResponse.reset



getCharacterEncoding
public String getCharacterEncoding()(Code)
Return the Charset parameter of content type A String instance



getLocale
public Locale getLocale()(Code)
Returns the locale assigned to the response.
See Also:   RimfaxeHttpServletResponse.setLocale



getOutputStream
public synchronized ServletOutputStream getOutputStream() throws IOException(Code)



getRimfaxeOutputStream
protected ServletOutputStream getRimfaxeOutputStream(boolean writerUsed) throws IOException(Code)



getSedaResponse
public SedaHttpResponse getSedaResponse()(Code)



getWriter
public synchronized java.io.PrintWriter getWriter() throws java.io.IOException(Code)
Returns a print writer for writing formatted text responses. The MIME type of the response will be modified, if necessary, to reflect the character encoding used, through the charset=... property. This means that the content type must be set before calling this method.
exception:
  UnsupportedEncodingException - if no such encoding can be provided
exception:
  IllegalStateException - if getOutputStream has been called on this same request.
exception:
  IOException - on other errors.



isCommitted
public boolean isCommitted()(Code)
Returns a boolean indicating if the response has been committed. A commited response has already had its status code and headers written. a boolean indicating if the response has beencommitted
See Also:   RimfaxeHttpServletResponse.setBufferSize
See Also:   RimfaxeHttpServletResponse.getBufferSize
See Also:   RimfaxeHttpServletResponse.flushBuffer
See Also:   RimfaxeHttpServletResponse.reset



isStreamObtained
protected boolean isStreamObtained()(Code)



reset
public void reset()(Code)
Clears any data that exists in the buffer as well as the status code and headers. If the response has been committed, this method throws an IllegalStateException.
exception:
  IllegalStateException - if the response has already beencommitted
See Also:   RimfaxeHttpServletResponse.setBufferSize
See Also:   RimfaxeHttpServletResponse.getBufferSize
See Also:   RimfaxeHttpServletResponse.flushBuffer
See Also:   RimfaxeHttpServletResponse.isCommitted



resetBuffer
public void resetBuffer()(Code)



sendError
public void sendError(int i, String msg) throws IOException(Code)
Sends an error response to the client using the specified status code and descriptive message. If setStatus has previously been called, it is reset to the error status code. The message is sent as the body of an HTML page, which is returned to the user to describe the problem. The page is sent with a default HTML header; the message is enclosed in simple body tags ().
Parameters:
  sc - - the status code
Parameters:
  msg - - the detail message
exception:
  IOException - If an I/O error has occurred.



sendError
public void sendError(int i) throws IOException(Code)
Sends an error response to the client using the specified status code and a default message.
Parameters:
  sc - - the status code
exception:
  IOException - If an I/O error has occurred.



sendRedirect
public void sendRedirect(String url) throws IOException(Code)
Sends a temporary redirect response to the client using the specified redirect location URL. The URL must be absolute (for example, https://hostname/path/file.html). Relative URLs are not permitted here.
Parameters:
  url - - the redirect location URL
exception:
  IOException - If an I/O error has occurred.



setBufferSize
public void setBufferSize(int size)(Code)
Sets the preferred buffer size for the body of the response. The servlet container will use a buffer at least as large as the size requested. The actual buffer size used can be found using getBufferSize.

A larger buffer allows more content to be written before anything is actually sent, thus providing the servlet with more time to set appropriate status codes and headers. A smaller buffer decreases server memory load and allows the client to start receiving data more quickly.

This method must be called before any response body content is written; if content has been written, this method throws an IllegalStateException.
Parameters:
  size - the preferred buffer size
exception:
  IllegalStateException - if this method is called aftercontent has been written
See Also:   RimfaxeHttpServletResponse.getBufferSize
See Also:   RimfaxeHttpServletResponse.flushBuffer
See Also:   RimfaxeHttpServletResponse.isCommitted
See Also:   RimfaxeHttpServletResponse.reset




setContentLength
public void setContentLength(int i)(Code)
Sets the content length for this response.
Parameters:
  len - - the content length



setContentType
public void setContentType(String spec)(Code)



setDateHeader
public void setDateHeader(String name, long date)(Code)
Adds a field to the response header with the given name and date-valued field. The date is specified in terms of milliseconds since the epoch. If the date field had already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.
Parameters:
  name - - the name of the header field
Parameters:
  value - - the header field's date value



setHeader
public void setHeader(String name, String value)(Code)
Adds a field to the response header with the given name and value. If the field had already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.
Parameters:
  name - - the name of the header field
Parameters:
  value - - the header field's value



setIntHeader
public void setIntHeader(String name, int value)(Code)
Adds a field to the response header with the given name and integer value. If the field had already been set, the new value overwrites the previous one. The containsHeader method can be used to test for the presence of a header before setting its value.
Parameters:
  name - - the name of the header field
Parameters:
  value - - the header field's integer value



setLocale
public void setLocale(Locale locale)(Code)
Sets the locale of the response, setting the headers (including the Content-Type's charset) as appropriate. This method should be called before a call to RimfaxeHttpServletResponse.getWriter . By default, the response locale is the default locale for the server.
Parameters:
  loc - the locale of the response
See Also:   RimfaxeHttpServletResponse.getLocale



setServletRequest
protected void setServletRequest(RimfaxeHttpServletRequest jrequest)(Code)



setStatus
public void setStatus(int i, String reason)(Code)
Sets the status code and message for this response. If the field had already been set, the new value overwrites the previous one. The message is sent as the body of an HTML page, which is returned to the user to describe the problem. The page is sent with a default HTML header; the message is enclosed in simple body tags ().
Parameters:
  i - - the status code
Parameters:
  reason - - the status message



setStatus
public void setStatus(int i)(Code)
Sets the status code for this response. This method is used to set the return status code when there is no error (for example, for the status codes SC_OK or SC_MOVED_TEMPORARILY). If there is an error, the sendError method should be used instead.
Parameters:
  i - - the status code



unsetHeader
public void unsetHeader(String name)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.