Interface StateAwareResponse
-
- All Superinterfaces:
Mutable,MutableRenderState,PortletResponse,RenderState
- All Known Subinterfaces:
ActionResponse,EventResponse
- All Known Implementing Classes:
ActionResponseWrapper,EventResponseWrapper,StateAwareResponseWrapper
public interface StateAwareResponse extends PortletResponse, MutableRenderState
TheStateAwareResponserepresents a response that can modify render state information or send events.If the render state is modified through this interface, the changes take effect for subsequent portlet render phase processing.
- Since:
- 2.0
- See Also:
RenderState,PortletResponse
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Map<String,String[]>getRenderParameterMap()Deprecated.As of version 3.0.voidremovePublicRenderParameter(String name)Deprecated.As of version 3.0.voidsetEvent(String name, Serializable value)Publishes an Event with the given payload in the default namespace.voidsetEvent(QName name, Serializable value)Publishes an Event with the given payload.voidsetRenderParameter(String key, String value)Deprecated.As of version 3.0.voidsetRenderParameter(String key, String... values)Deprecated.As of version 3.0.voidsetRenderParameters(Map<String,String[]> parameters)Deprecated.As of version 3.0.-
Methods inherited from interface jakarta.portlet.MutableRenderState
getRenderParameters, setPortletMode, setWindowState
-
Methods inherited from interface jakarta.portlet.PortletResponse
addProperty, addProperty, addProperty, createElement, encodeURL, getNamespace, getProperty, getPropertyNames, getPropertyValues, setProperty
-
Methods inherited from interface jakarta.portlet.RenderState
getPortletMode, getWindowState
-
-
-
-
Method Detail
-
setRenderParameters
@Deprecated void setRenderParameters(Map<String,String[]> parameters)
Deprecated.As of version 3.0. UseMutableRenderState.getRenderParameters()instead.Sets a parameter map for the render request.These parameters will be accessible in all sub-sequent render calls via the
PortletRequest.getParametercall until a new request is targeted to the portlet.The given parameters do not need to be encoded prior to calling this method.
The portlet should not modify the map any further after calling this method.
This method can be used to set both public and private render parameters.
These parameters will be accessible in all subsequent render calls via the PortletRequest.getParameter call until a new request is targeted to the portlet.
Any previously set private render parameter that is not contained in the new map is removed. However, public render parameters cannot be removed by excluding them from the map. Public render parameters that are not included in the map remain unchanged.
The given parameters do not need to be encoded prior to calling this method.
The portlet should not modify the map any further after calling this method.
- Parameters:
parameters- the render parameters Map containing parameter names for the render phase as keys and parameter values as map values. The keys in the parameter map must be of type String and may not be null or the empty string (""). The values in the parameter map must be of type String array (String[]). The values array may not be null; however, the values array elements may be null.- Throws:
IllegalArgumentException- if parameters isnull, if any of the keys in the Map arenull, if any of the keys is not a String, or if any of the values is not a String array.IllegalStateException- if the method is invoked aftersendRedirecthas been called.
-
setRenderParameter
@Deprecated void setRenderParameter(String key, String value)
Deprecated.As of version 3.0. UseMutableRenderState.getRenderParameters()instead.Sets a String parameter for the render request.These parameters will be accessible in all subsequent render calls until an action or render request is targeted to the portlet.
This method replaces all parameters with the given key.
The given parameter do not need to be encoded prior to calling this method.
A parameter value of
nullindicates that this parameter should be removed. However, an empty string value ("") is allowed.- Parameters:
key- key of the render parametervalue- value of the render parameter- Throws:
IllegalArgumentException- if key isnull; if an attempt is made to set a public render parameter tonull.IllegalStateException- if the method is invoked aftersendRedirecthas been called.
-
setRenderParameter
@Deprecated void setRenderParameter(String key, String... values)
Deprecated.As of version 3.0. UseMutableRenderState.getRenderParameters()instead.Sets a multi-valued String parameter for the render request.These parameters will be accessible in all subsequent render calls until an action or render request is targeted to the portlet.
This method replaces all parameter values with the given key.
The given parameter do not need to be encoded prior to calling this method.
A values parameter of
nullindicates that this parameter should be removed.If the values parameter is not null, elements of the array may be null.
- Parameters:
key- key of the render parametervalues- values of the render parameter- Throws:
IllegalArgumentException- if name isnull; if an element of the values array isnull; if an attempt is made to set a public render parameter tonull.IllegalStateException- if the method is invoked aftersendRedirecthas been called.
-
setEvent
void setEvent(QName name, Serializable value)
Publishes an Event with the given payload.The object type of the value must be compliant with the specified event type in the portlet deployment descriptor.
The value must have a valid JAXB binding and be serializable.
- Parameters:
name- the event name to publish, must not benullvalue- the value of this event, must have a valid JAXB binding and be serializable, ornull.- Throws:
IllegalArgumentException- if name isnull, the value is not serializable, the value does not have a valid JAXB binding, the object type of the value is not the same as specified in the portlet deployment descriptor for this event name.- Since:
- 2.0
-
setEvent
void setEvent(String name, Serializable value)
Publishes an Event with the given payload in the default namespace.The name is treated as local part of the event QName and the namespace is either taken from the
default-event-namespaceelement in the portlet deployment descriptor, or if this element is not provided the XML default namespace XMLConstants.NULL_NS_URI is used.The object type of the value must be compliant with the specified event type in the portlet deployment descriptor.
The value must have a valid JAXB binding and be serializable.
- Parameters:
name- the local part of the event name to publish, must not benullvalue- the value of this event, must have a valid JAXB binding and be serializable, ornull.- Throws:
IllegalArgumentException- if name isnull, the value is not serializable, the value does not have a valid JAXB binding, the object type of the value is not the same as specified in the portlet deployment descriptor for this event name.- Since:
- 2.0
-
getRenderParameterMap
@Deprecated Map<String,String[]> getRenderParameterMap()
Deprecated.As of version 3.0. UseMutableRenderState.getRenderParameters()instead.Returns aMapof the render parameters currently set on this response.The values in the returned
Mapare of type String array (String[]).The contents of the returned map are immutable in the sense that modifying the map does not directly affect the render parameters. In order to set the parameters using the modified map, the
setRenderParameters(Map)method must be used.If no parameters exist this method returns an empty
Map.- Returns:
Mapcontaining render parameter names as keys and parameter values as map values, or an emptyMapif no parameters exist. The keys in the parameter map are of type String. The values in the parameter map are of type String array (String[]).- Since:
- 2.0
-
removePublicRenderParameter
@Deprecated void removePublicRenderParameter(String name)
Deprecated.As of version 3.0. UseMutableRenderState.getRenderParameters()instead.Removes the specified public render parameter. The name must reference a public render parameter defined in the portlet deployment descriptor under thepublic-render-parameterelement with theidentifiermapping to the parameter name.- Parameters:
name- aStringspecifying the name of the public render parameter to be removed- Throws:
IllegalArgumentException- if name isnull.- Since:
- 2.0
-
-