|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Objectorg.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 |
|---|
| 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,
java.util.Locale locale)
Create an instance specifying a locale. |
|
WebContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
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()
Deprecated. Get attributes from the ServletContext object directly instead. Will be removed in 3.0. |
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()
Deprecated. Get attributes from the HttpServletRequest object directly instead. Will be removed in 3.0. |
VariablesMap<String,String[]> |
getRequestParameters()
Deprecated. Get parameters from the HttpServletRequest object directly instead. Will be removed in 3.0. |
javax.servlet.ServletContext |
getServletContext()
Returns the ServletContext object associated with the
web application. |
VariablesMap<String,Object> |
getSessionAttributes()
Deprecated. Get attributes from the HttpSession object directly instead. Will be removed in 3.0. |
| 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 |
| Constructor Detail |
|---|
public 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
public WebContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext,
java.util.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.
public WebContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
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.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. Can be null if no variables are to added.| 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 IWebContextpublic javax.servlet.http.HttpServletResponse getHttpServletResponse()
IWebContext
Returns the HttpServletResponse object associated with the
request this context has been created for.
getHttpServletResponse in interface IWebContextpublic javax.servlet.http.HttpSession getHttpSession()
IWebContext
Returns the HttpSession object associated with the
request this context has been created for.
getHttpSession in interface IWebContextpublic javax.servlet.ServletContext getServletContext()
IWebContext
Returns the ServletContext object associated with the
web application.
getServletContext in interface IWebContext@Deprecated 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@Deprecated 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@Deprecated 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@Deprecated 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 IWebContextprotected IContextExecutionInfo buildContextExecutionInfo(String templateName)
AbstractContext
Creates the specific instance of IContextExecutionInfo to be added
to the context as the execInfo variable.
buildContextExecutionInfo in class AbstractContexttemplateName - the name of the template being executed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||