public class VaadinServletContext extends Object implements VaadinContext
VaadinContext that goes with VaadinServletService.| Constructor and Description |
|---|
VaadinServletContext(javax.servlet.ServletContext context)
Creates an instance of this context with given
ServletContext. |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
getAttribute(Class<T> type,
Supplier<T> defaultValueSupplier)
Returns value of the specified attribute, creating a default value if not
present.
|
javax.servlet.ServletContext |
getContext()
Returns the underlying context.
|
void |
removeAttribute(Class<?> clazz)
Removes an attribute identified by the given type.
|
<T> void |
setAttribute(T value)
Sets the attribute value, overriding previously existing one.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAttributepublic VaadinServletContext(javax.servlet.ServletContext context)
ServletContext.context - Context.public javax.servlet.ServletContext getContext()
ServletContext.public <T> T getAttribute(Class<T> type, Supplier<T> defaultValueSupplier)
VaadinContextgetAttribute in interface VaadinContexttype - Type of the attribute.defaultValueSupplier - Supplier of the default value, called when there is no
value already present. May be null.public <T> void setAttribute(T value)
VaadinContextsetAttribute in interface VaadinContextvalue - Value of the attribute. May not be null.for removing attributes.public void removeAttribute(Class<?> clazz)
VaadinContextremoveAttribute in interface VaadinContextclazz - Attribute type.for setting attributes.Copyright © 2000–2019 Vaadin Ltd. All rights reserved.