|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.thymeleaf.context.AbstractContext org.thymeleaf.context.WebContext
public class WebContext
Standard implementation for the IWebContext
interface.
This IContext
implementation uses a WebContextExecutionInfo
object as its
IContextExecutionInfo
implementation.
Field Summary | |
---|---|
static String |
APPLICATION_VARIABLE_NAME
Name of the context variable that contains the application (servlet context) attributes. |
static String |
PARAM_VARIABLE_NAME
Name of the context variable that contains the request parameters. |
static String |
SESSION_VARIABLE_NAME
Name of the context variable that contains the session attributes. |
Fields inherited from class org.thymeleaf.context.AbstractContext |
---|
EXEC_INFO_VARIABLE_NAME |
Constructor Summary | |
---|---|
WebContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext servletContext)
Create an instance without specifying a locale. |
|
WebContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext servletContext,
java.util.Locale locale)
Create an instance specifying a locale. |
|
WebContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext servletContext,
java.util.Locale locale,
java.util.Map<String,?> variables)
Create an instance specifying a locale and an initial set of context variables. |
Method Summary | |
---|---|
protected IContextExecutionInfo |
buildContextExecutionInfo(String templateName)
Creates the specific instance of IContextExecutionInfo to be added
to the context as the execInfo variable. |
VariablesMap<String,Object> |
getApplicationAttributes()
Returns a VariablesMap object with all the attributes associated
with the ServletContext object linked to the
HttpServletRequest used for creating the context. |
javax.servlet.http.HttpServletRequest |
getHttpServletRequest()
Returns the HttpServletRequest object associated with the
request this context has been created for. |
javax.servlet.http.HttpSession |
getHttpSession()
Returns the HttpSession object associated with the
request this context has been created for. |
VariablesMap<String,Object> |
getRequestAttributes()
Returns a VariablesMap object with all the attributes associated
with the HttpServletRequest used for creating the context. |
VariablesMap<String,String[]> |
getRequestParameters()
Returns a VariablesMap object with all the parameters associated
with the HttpServletRequest used for creating the context. |
javax.servlet.ServletContext |
getServletContext()
Returns the ServletContext object associated with the
web application. |
VariablesMap<String,Object> |
getSessionAttributes()
Returns a VariablesMap object with all the attributes associated
with the HttpSession object linked to the
HttpServletRequest used for creating the context. |
Methods inherited from class org.thymeleaf.context.AbstractContext |
---|
addContextExecutionInfo, clearVariables, getLocale, getVariables, setLocale, setVariable, setVariables |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.thymeleaf.context.IContext |
---|
addContextExecutionInfo, getLocale, getVariables |
Field Detail |
---|
public static final String PARAM_VARIABLE_NAME
Name of the context variable that contains the request parameters.
public static final String SESSION_VARIABLE_NAME
Name of the context variable that contains the session attributes.
public static final String APPLICATION_VARIABLE_NAME
Name of the context variable that contains the application (servlet context) attributes.
Constructor Detail |
---|
public WebContext(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext servletContext)
Create an instance without specifying a locale. Using this constructor, the default locale (Locale.getDefault()) will be used.
request
- the HttpServletRequest
that this context will be related to.servletContext
- the servlet context objectpublic WebContext(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext servletContext, java.util.Locale locale)
Create an instance specifying a locale.
request
- the HttpServletRequest
that this context will be related to.servletContext
- the servlet context objectlocale
- the locale to be used.public WebContext(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext servletContext, java.util.Locale locale, java.util.Map<String,?> variables)
Create an instance specifying a locale and an initial set of context variables.
request
- the HttpServletRequest
that this context will be related to.servletContext
- the servlet context objectlocale
- the locale to be used.variables
- the initial set of context variables.Method Detail |
---|
public javax.servlet.http.HttpServletRequest getHttpServletRequest()
IWebContext
Returns the HttpServletRequest
object associated with the
request this context has been created for.
getHttpServletRequest
in interface IWebContext
public javax.servlet.http.HttpSession getHttpSession()
IWebContext
Returns the HttpSession
object associated with the
request this context has been created for.
getHttpSession
in interface IWebContext
public javax.servlet.ServletContext getServletContext()
IWebContext
Returns the ServletContext
object associated with the
web application.
getServletContext
in interface IWebContext
public VariablesMap<String,String[]> getRequestParameters()
IWebContext
Returns a VariablesMap
object with all the parameters associated
with the HttpServletRequest
used for creating the context.
getRequestParameters
in interface IWebContext
public VariablesMap<String,Object> getRequestAttributes()
IWebContext
Returns a VariablesMap
object with all the attributes associated
with the HttpServletRequest
used for creating the context.
getRequestAttributes
in interface IWebContext
public VariablesMap<String,Object> getSessionAttributes()
IWebContext
Returns a VariablesMap
object with all the attributes associated
with the HttpSession
object linked to the
HttpServletRequest
used for creating the context.
getSessionAttributes
in interface IWebContext
public VariablesMap<String,Object> getApplicationAttributes()
IWebContext
Returns a VariablesMap
object with all the attributes associated
with the ServletContext
object linked to the
HttpServletRequest
used for creating the context.
getApplicationAttributes
in interface IWebContext
protected IContextExecutionInfo buildContextExecutionInfo(String templateName)
AbstractContext
Creates the specific instance of IContextExecutionInfo
to be added
to the context as the execInfo variable.
buildContextExecutionInfo
in class AbstractContext
templateName
- the name of the template being executed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |