public class RedirectAttributesModelMap extends org.springframework.ui.ModelMap implements RedirectAttributes
ModelMap implementation of RedirectAttributes that formats
values as Strings using a DataBinder. Also provides a place to store
flash attributes so they can survive a redirect without the need to be
embedded in the redirect URL.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
RedirectAttributesModelMap()
Default constructor without a DataBinder.
|
RedirectAttributesModelMap(org.springframework.validation.DataBinder dataBinder)
Class constructor.
|
| Modifier and Type | Method and Description |
|---|---|
RedirectAttributesModelMap |
addAllAttributes(Collection<?> attributeValues) |
RedirectAttributesModelMap |
addAllAttributes(Map<String,?> attributes) |
RedirectAttributesModelMap |
addAttribute(Object attributeValue) |
RedirectAttributesModelMap |
addAttribute(String attributeName,
Object attributeValue) |
RedirectAttributes |
addFlashAttribute(Object attributeValue)
Add the given flash storage using a
generated name. |
RedirectAttributes |
addFlashAttribute(String attributeName,
Object attributeValue)
Add the given flash attribute.
|
Map<String,Object> |
asMap() |
Map<String,?> |
getFlashAttributes()
Return the attributes candidate for flash storage or an empty Map.
|
RedirectAttributesModelMap |
mergeAttributes(Map<String,?> attributes) |
Object |
put(String key,
Object value) |
void |
putAll(Map<? extends String,? extends Object> map) |
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putIfAbsent, remove, remove, replace, replace, sizeequals, hashCode, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, putIfAbsent, remove, remove, replace, replace, sizepublic RedirectAttributesModelMap(org.springframework.validation.DataBinder dataBinder)
dataBinder - used to format attribute values as Strings.public RedirectAttributesModelMap()
AbstractMap.toString().public Map<String,?> getFlashAttributes()
getFlashAttributes in interface RedirectAttributespublic RedirectAttributesModelMap addAttribute(String attributeName, Object attributeValue)
Formats the attribute value as a String before adding it.
addAttribute in interface org.springframework.ui.ModeladdAttribute in interface RedirectAttributesaddAttribute in class org.springframework.ui.ModelMappublic RedirectAttributesModelMap addAttribute(Object attributeValue)
Formats the attribute value as a String before adding it.
addAttribute in interface org.springframework.ui.ModeladdAttribute in interface RedirectAttributesaddAttribute in class org.springframework.ui.ModelMappublic RedirectAttributesModelMap addAllAttributes(Collection<?> attributeValues)
Each attribute value is formatted as a String before being added.
addAllAttributes in interface org.springframework.ui.ModeladdAllAttributes in interface RedirectAttributesaddAllAttributes in class org.springframework.ui.ModelMappublic RedirectAttributesModelMap addAllAttributes(Map<String,?> attributes)
Each attribute value is formatted as a String before being added.
addAllAttributes in interface org.springframework.ui.ModeladdAllAttributes in class org.springframework.ui.ModelMappublic RedirectAttributesModelMap mergeAttributes(Map<String,?> attributes)
Each attribute value is formatted as a String before being merged.
mergeAttributes in interface org.springframework.ui.ModelmergeAttributes in interface RedirectAttributesmergeAttributes in class org.springframework.ui.ModelMappublic Map<String,Object> asMap()
asMap in interface org.springframework.ui.Modelpublic Object put(String key, Object value)
The value is formatted as a String before being added.
public void putAll(Map<? extends String,? extends Object> map)
Each value is formatted as a String before being added.
public RedirectAttributes addFlashAttribute(String attributeName, Object attributeValue)
RedirectAttributesaddFlashAttribute in interface RedirectAttributesattributeName - the attribute name; never nullattributeValue - the attribute value; may be nullpublic RedirectAttributes addFlashAttribute(Object attributeValue)
RedirectAttributesgenerated name.addFlashAttribute in interface RedirectAttributesattributeValue - the flash attribute value; never null