public class ResponseFactory extends Object
Factory class for returning ResponseStream
or
ResponseWriter
instances that may be used to produce output
response content that is independent of whether we are running in a servlet
or portlet environment. The RenderKit
for the current request
will be used to manufacture stream or writer instances, if necessary.
Constructor and Description |
---|
ResponseFactory() |
Modifier and Type | Method and Description |
---|---|
protected javax.faces.context.ResponseStream |
createResponseStream(javax.faces.context.FacesContext context,
String contentType)
Create a new
ResponseStream that writes to the servlet
or portlet response stream for the current request. |
protected javax.faces.context.ResponseWriter |
createResponseWriter(javax.faces.context.FacesContext context,
String contentType)
Create a new
ResponseWriter that writes to the servlet
or portlet response writer for the current request. |
javax.faces.context.ResponseStream |
getResponseStream(javax.faces.context.FacesContext context,
String contentType)
Return the configured
ResponseStream for the current
request, creating and installing a new one if necessary. |
javax.faces.context.ResponseWriter |
getResponseWriter(javax.faces.context.FacesContext context,
String contentType)
Return the configured
ResponseWriter for the current
request, creating and installing a new one if necessary. |
protected javax.faces.render.RenderKit |
renderKit(javax.faces.context.FacesContext context)
Return the relevant
RenderKit to construct response
stream or writer instances for this request. |
public javax.faces.context.ResponseStream getResponseStream(javax.faces.context.FacesContext context, String contentType)
Return the configured ResponseStream
for the current
request, creating and installing a new one if necessary.
context
- FacesContext
for the current requestcontentType
- Content type to be set on the response,
or null
to let this be defaultedpublic javax.faces.context.ResponseWriter getResponseWriter(javax.faces.context.FacesContext context, String contentType)
Return the configured ResponseWriter
for the current
request, creating and installing a new one if necessary.
context
- FacesContext
for the current requestcontentType
- Content type to be set on the response,
or null
to let this be defaultedprotected javax.faces.context.ResponseStream createResponseStream(javax.faces.context.FacesContext context, String contentType)
Create a new ResponseStream
that writes to the servlet
or portlet response stream for the current request.
context
- FacesContext
for the current requestcontentType
- Content type to be set on the response,
or null
to let this be defaultedIllegalStateException
- if a writer for the current response
has already been acquiredprotected javax.faces.context.ResponseWriter createResponseWriter(javax.faces.context.FacesContext context, String contentType)
Create a new ResponseWriter
that writes to the servlet
or portlet response writer for the current request.
context
- FacesContext
for the current requestcontentType
- Content type to be set on the response,
or null
to let this be defaultedIllegalStateException
- if a writer for the current response
has already been acquiredprotected javax.faces.render.RenderKit renderKit(javax.faces.context.FacesContext context)
Return the relevant RenderKit
to construct response
stream or writer instances for this request. If there is no render kit
identified yet, the default RenderKit
will be returned.
context
- FacesContext
for the current requestCopyright © 2004-2013 Apache Software Foundation. All Rights Reserved.