public class SpringWebContextProvider extends Object implements ThymeleafWebContextProvider
SpringWebContext
for Thymeleaf v2.
This is used to mimic the behavior of ThymeleafView
in order to give
access to HttpServletRequest
, HttpServletResponse
and
ServletContext
from templates.Constructor and Description |
---|
SpringWebContextProvider() |
Modifier and Type | Method and Description |
---|---|
org.thymeleaf.context.IContext |
getWebContext(Context context,
org.thymeleaf.context.IContext base,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext,
org.springframework.context.ApplicationContext applicationContext,
Map<String,Object> springModel)
Generates the suitable context for a Web application.
|
public org.thymeleaf.context.IContext getWebContext(Context context, org.thymeleaf.context.IContext base, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext, org.springframework.context.ApplicationContext applicationContext, Map<String,Object> springModel)
ThymeleafWebContextProvider
getWebContext
in interface ThymeleafWebContextProvider
context
- Ogham original context that may be used to retrieve extra
informationbase
- Thymeleaf context that has been converted from Ogham original
context. It contains the base variables extracted from Ogham
context.request
- the current HTTP requestresponse
- the current HTTP responseservletContext
- the servlet execution contextapplicationContext
- the application contextspringModel
- the model that contains both variables extracted from Ogham
context and Spring variables (static variables, evaluation
context, ...)Copyright © 2021. All rights reserved.