Package org.thymeleaf.context
Class WebExpressionContext
- Object
-
- org.thymeleaf.context.AbstractContext
-
- org.thymeleaf.context.AbstractExpressionContext
-
- org.thymeleaf.context.WebExpressionContext
-
- All Implemented Interfaces:
IContext
,IExpressionContext
,IWebContext
public final class WebExpressionContext extends AbstractExpressionContext implements IWebContext
Basic web-oriented implementation of the
IExpressionContext
andIWebContext
interfaces.This class is not thread-safe, and should not be shared across executions of templates.
- Since:
- 3.0.0
- Author:
- Daniel Fernández
-
-
Constructor Summary
Constructors Constructor Description WebExpressionContext(IEngineConfiguration configuration, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext)
WebExpressionContext(IEngineConfiguration configuration, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext, Locale locale)
WebExpressionContext(IEngineConfiguration configuration, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext, Locale locale, Map<String,Object> variables)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.servlet.http.HttpServletRequest
getRequest()
Returns theHttpServletRequest
object associated with the template execution.javax.servlet.http.HttpServletResponse
getResponse()
Returns theHttpServletResponse
object associated with the template execution.javax.servlet.ServletContext
getServletContext()
Returns theServletContext
object associated with the template execution.javax.servlet.http.HttpSession
getSession()
Returns theHttpSession
object associated with the template execution, or null if there is no session.-
Methods inherited from class org.thymeleaf.context.AbstractExpressionContext
getConfiguration, getExpressionObjects
-
Methods inherited from class org.thymeleaf.context.AbstractContext
clearVariables, containsVariable, getLocale, getVariable, getVariableNames, removeVariable, setLocale, setVariable, setVariables
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.thymeleaf.context.IContext
containsVariable, getLocale, getVariable, getVariableNames
-
-
-
-
Constructor Detail
-
WebExpressionContext
public WebExpressionContext(IEngineConfiguration configuration, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext)
-
WebExpressionContext
public WebExpressionContext(IEngineConfiguration configuration, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext, Locale locale)
-
WebExpressionContext
public WebExpressionContext(IEngineConfiguration configuration, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext, Locale locale, Map<String,Object> variables)
-
-
Method Detail
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
Description copied from interface:IWebContext
Returns the
HttpServletRequest
object associated with the template execution.- Specified by:
getRequest
in interfaceIWebContext
- Returns:
- the request object.
-
getSession
public javax.servlet.http.HttpSession getSession()
Description copied from interface:IWebContext
Returns the
HttpSession
object associated with the template execution, or null if there is no session.- Specified by:
getSession
in interfaceIWebContext
- Returns:
- the session object. Might be null if no session has been created.
-
getResponse
public javax.servlet.http.HttpServletResponse getResponse()
Description copied from interface:IWebContext
Returns the
HttpServletResponse
object associated with the template execution.- Specified by:
getResponse
in interfaceIWebContext
- Returns:
- the response object.
-
getServletContext
public javax.servlet.ServletContext getServletContext()
Description copied from interface:IWebContext
Returns the
ServletContext
object associated with the template execution.- Specified by:
getServletContext
in interfaceIWebContext
- Returns:
- the servlet context object.
-
-