public class PartialResponseWriter extends ResponseWriterWrapper
PartialResponseWriter
decorates an existing ResponseWriter
to support the
generation of a partial response suitable for Ajax operations.
In addition to the markup generation methods inherited from
javax.faces.context.ResponseWriter
, this class provides
methods for constructing the standard partial response elements.
Modifier and Type | Field and Description |
---|---|
static String |
RENDER_ALL_MARKER
Reserved ID value to indicate entire ViewRoot. |
static String |
VIEW_STATE_MARKER
Reserved ID value to indicate serialized ViewState. |
Constructor and Description |
---|
PartialResponseWriter(ResponseWriter writer)
Create a |
Modifier and Type | Method and Description |
---|---|
void |
delete(String targetId)
Write a delete operation. |
void |
endDocument()
Write the end of a partial response. |
void |
endError()
Write the end of an error. |
void |
endEval()
Write the end of an eval operation. |
void |
endExtension()
Write the end of an extension operation. |
void |
endInsert()
Write the end of an insert operation. |
void |
endUpdate()
Write the end of an update operation. |
void |
redirect(String url)
Write a redirect operation. |
void |
startDocument()
Write the start of a partial response. |
void |
startError(String errorName)
Write the start of an error. |
void |
startEval()
Write the start of an eval operation. |
void |
startExtension(Map<String,String> attributes)
Write the start of an extension operation. |
void |
startInsertAfter(String targetId)
Write the start of an insert operation where the contents will be inserted after the specified target node. |
void |
startInsertBefore(String targetId)
Write the start of an insert operation where the contents will be inserted before the specified target node. |
void |
startUpdate(String targetId)
Write the start of an update operation. |
void |
updateAttributes(String targetId,
Map<String,String> attributes)
Write an attribute update operation. |
cloneWithWriter, close, endCDATA, endElement, flush, getCharacterEncoding, getContentType, getWrapped, startCDATA, startElement, write, writeAttribute, writeComment, writeDoctype, writePreamble, writeText, writeText, writeText, writeURIAttribute
public static final String RENDER_ALL_MARKER
Reserved ID value to indicate entire ViewRoot.
public static final String VIEW_STATE_MARKER
Reserved ID value to indicate serialized ViewState.
public PartialResponseWriter(ResponseWriter writer)
Create a PartialResponseWriter
.
writer
- The writer to wrap.public void startDocument() throws IOException
Write the start of a partial response.
If UIViewRoot
is an instance of
NamingContainer
, then write
UIComponent.getContainerClientId(FacesContext)
as value of the
id
attribute of the root element.
startDocument
in class ResponseWriterWrapper
IOException
- if an input/output error occursResponseWriter.startDocument()
public void endDocument() throws IOException
Write the end of a partial response.
endDocument
in class ResponseWriterWrapper
IOException
- if an input/output error occursResponseWriter.endDocument()
public void startInsertBefore(String targetId) throws IOException
Write the start of an insert operation where the contents will be inserted before the specified target node.
targetId
- ID of the node insertion should occur beforeIOException
- if an input/output error occurspublic void startInsertAfter(String targetId) throws IOException
Write the start of an insert operation where the contents will be inserted after the specified target node.
targetId
- ID of the node insertion should occur afterIOException
- if an input/output error occurspublic void endInsert() throws IOException
Write the end of an insert operation.
IOException
- if an input/output error occurspublic void startUpdate(String targetId) throws IOException
Write the start of an update operation.
targetId
- ID of the node to be updatedIOException
- if an input/output error occurspublic void endUpdate() throws IOException
Write the end of an update operation.
IOException
- if an input/output error occurspublic void updateAttributes(String targetId, Map<String,String> attributes) throws IOException
Write an attribute update operation.
targetId
- ID of the node to be updatedattributes
- Map of attribute name/value pairs to be updatedIOException
- if an input/output error occurspublic void delete(String targetId) throws IOException
Write a delete operation.
targetId
- ID of the node to be deletedIOException
- if an input/output error occurspublic void redirect(String url) throws IOException
Write a redirect operation.
url
- URL to redirect toIOException
- if an input/output error occurspublic void startEval() throws IOException
Write the start of an eval operation.
IOException
- if an input/output error occurspublic void endEval() throws IOException
Write the end of an eval operation.
IOException
- if an input/output error occurspublic void startExtension(Map<String,String> attributes) throws IOException
Write the start of an extension operation.
attributes
- String name/value pairs for extension element attributesIOException
- if an input/output error occurspublic void endExtension() throws IOException
Write the end of an extension operation.
IOException
- if an input/output error occurspublic void startError(String errorName) throws IOException
Write the start of an error.
errorName
- Descriptive string for the errorIOException
- if an input/output error occurspublic void endError() throws IOException
Write the end of an error.
IOException
- if an input/output error occursCopyright © 2019 Eclipse Foundation.
Use is subject to license terms.