|
||||||||||
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
Deprecated. Use WebVariablesMap.APPLICATION_VARIABLE_NAME instead.
Will be removed in 2.1.x |
static String |
PARAM_VARIABLE_NAME
Deprecated. Use WebVariablesMap.PARAM_VARIABLE_NAME instead.
Will be removed in 2.1.x |
static String |
SESSION_VARIABLE_NAME
Deprecated. Use WebVariablesMap.SESSION_VARIABLE_NAME instead.
Will be removed in 2.1.x |
Fields inherited from class org.thymeleaf.context.AbstractContext |
---|
EXEC_INFO_VARIABLE_NAME |
Constructor Summary | |
---|---|
WebContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext)
Create an instance without specifying a locale. |
|
WebContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext,
Locale locale)
Create an instance specifying a locale. |
|
WebContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext,
Locale locale,
Map<String,?> variables)
Create an instance specifying a locale and an initial set of context variables. |
|
WebContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext servletContext)
Deprecated. use the equivalent constructor with an additional 'response' parameter. Will be removed in 2.1.x. |
|
WebContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext servletContext,
Locale locale)
Deprecated. use the equivalent constructor with an additional 'response' parameter. Will be removed in 2.1.x. |
|
WebContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.ServletContext servletContext,
Locale locale,
Map<String,?> variables)
Deprecated. use the equivalent constructor with an additional 'response' parameter. Will be removed in 2.1.x. |
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.HttpServletResponse |
getHttpServletResponse()
Returns the HttpServletResponse 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 |
---|
@Deprecated public static final String PARAM_VARIABLE_NAME
WebVariablesMap.PARAM_VARIABLE_NAME
instead.
Will be removed in 2.1.xName of the context variable that contains the request parameters.
@Deprecated public static final String SESSION_VARIABLE_NAME
WebVariablesMap.SESSION_VARIABLE_NAME
instead.
Will be removed in 2.1.xName of the context variable that contains the session attributes.
@Deprecated public static final String APPLICATION_VARIABLE_NAME
WebVariablesMap.APPLICATION_VARIABLE_NAME
instead.
Will be removed in 2.1.xName of the context variable that contains the application (servlet context) attributes.
Constructor Detail |
---|
@Deprecated 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.http.HttpServletResponse response, 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.response
- the HttpServletResponse
that this context will be related to.servletContext
- the servlet context object@Deprecated public WebContext(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext servletContext, 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.http.HttpServletResponse response, javax.servlet.ServletContext servletContext, Locale locale)
Create an instance specifying a locale.
request
- the HttpServletRequest
that this context will be related to.response
- the HttpServletResponse
that this context will be related to.servletContext
- the servlet context objectlocale
- the locale to be used.@Deprecated public WebContext(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext servletContext, Locale locale, 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.public WebContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext, Locale locale, 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.response
- the HttpServletResponse
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.HttpServletResponse getHttpServletResponse()
IWebContext
Returns the HttpServletResponse
object associated with the
request this context has been created for.
getHttpServletResponse
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 |