Class SpringWebMvcThymeleafRequestContext
- Object
-
- org.thymeleaf.spring5.context.webmvc.SpringWebMvcThymeleafRequestContext
-
- All Implemented Interfaces:
IThymeleafRequestContext
public class SpringWebMvcThymeleafRequestContext extends Object implements IThymeleafRequestContext
Implementation of the
IThymeleafRequestContext
interface, meant to wrap a SpringRequestContext
object.- Since:
- 3.0.3
- Author:
- Daniel Fernández
- See Also:
RequestContext
-
-
Constructor Summary
Constructors Constructor Description SpringWebMvcThymeleafRequestContext(org.springframework.web.servlet.support.RequestContext requestContext, javax.servlet.http.HttpServletRequest httpServletRequest)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
changeLocale(Locale locale)
void
changeLocale(Locale locale, TimeZone timeZone)
IThymeleafBindStatus
getBindStatus(String path)
IThymeleafBindStatus
getBindStatus(String path, boolean htmlEscape)
String
getContextPath()
String
getContextUrl(String relativeUrl)
String
getContextUrl(String relativeUrl, Map<String,?> params)
Boolean
getDefaultHtmlEscape()
Optional<org.springframework.validation.Errors>
getErrors(String name)
Optional<org.springframework.validation.Errors>
getErrors(String name, boolean htmlEscape)
javax.servlet.http.HttpServletRequest
getHttpServletRequest()
Locale
getLocale()
String
getMessage(String code)
String
getMessage(String code, Object[] args)
String
getMessage(String code, Object[] args, boolean htmlEscape)
String
getMessage(String code, Object[] args, String defaultMessage)
String
getMessage(String code, Object[] args, String defaultMessage, boolean htmlEscape)
String
getMessage(String code, String defaultMessage)
String
getMessage(String code, List<?> args)
String
getMessage(String code, List<?> args, String defaultMessage)
String
getMessage(org.springframework.context.MessageSourceResolvable resolvable)
String
getMessage(org.springframework.context.MessageSourceResolvable resolvable, boolean htmlEscape)
org.springframework.context.MessageSource
getMessageSource()
Map<String,Object>
getModel()
String
getQueryString()
IThymeleafRequestDataValueProcessor
getRequestDataValueProcessor()
String
getRequestPath()
org.springframework.ui.context.Theme
getTheme()
TimeZone
getTimeZone()
boolean
isDefaultHtmlEscape()
void
setDefaultHtmlEscape(boolean defaultHtmlEscape)
String
toString()
-
-
-
Method Detail
-
getHttpServletRequest
public javax.servlet.http.HttpServletRequest getHttpServletRequest()
-
getMessageSource
public org.springframework.context.MessageSource getMessageSource()
- Specified by:
getMessageSource
in interfaceIThymeleafRequestContext
-
getModel
public Map<String,Object> getModel()
- Specified by:
getModel
in interfaceIThymeleafRequestContext
-
getLocale
public Locale getLocale()
- Specified by:
getLocale
in interfaceIThymeleafRequestContext
-
getTimeZone
public TimeZone getTimeZone()
- Specified by:
getTimeZone
in interfaceIThymeleafRequestContext
-
changeLocale
public void changeLocale(Locale locale)
- Specified by:
changeLocale
in interfaceIThymeleafRequestContext
-
changeLocale
public void changeLocale(Locale locale, TimeZone timeZone)
- Specified by:
changeLocale
in interfaceIThymeleafRequestContext
-
setDefaultHtmlEscape
public void setDefaultHtmlEscape(boolean defaultHtmlEscape)
- Specified by:
setDefaultHtmlEscape
in interfaceIThymeleafRequestContext
-
isDefaultHtmlEscape
public boolean isDefaultHtmlEscape()
- Specified by:
isDefaultHtmlEscape
in interfaceIThymeleafRequestContext
-
getDefaultHtmlEscape
public Boolean getDefaultHtmlEscape()
- Specified by:
getDefaultHtmlEscape
in interfaceIThymeleafRequestContext
-
getContextPath
public String getContextPath()
- Specified by:
getContextPath
in interfaceIThymeleafRequestContext
-
getContextUrl
public String getContextUrl(String relativeUrl)
- Specified by:
getContextUrl
in interfaceIThymeleafRequestContext
-
getContextUrl
public String getContextUrl(String relativeUrl, Map<String,?> params)
- Specified by:
getContextUrl
in interfaceIThymeleafRequestContext
-
getRequestPath
public String getRequestPath()
- Specified by:
getRequestPath
in interfaceIThymeleafRequestContext
-
getQueryString
public String getQueryString()
- Specified by:
getQueryString
in interfaceIThymeleafRequestContext
-
getMessage
public String getMessage(String code, String defaultMessage)
- Specified by:
getMessage
in interfaceIThymeleafRequestContext
-
getMessage
public String getMessage(String code, Object[] args, String defaultMessage)
- Specified by:
getMessage
in interfaceIThymeleafRequestContext
-
getMessage
public String getMessage(String code, List<?> args, String defaultMessage)
- Specified by:
getMessage
in interfaceIThymeleafRequestContext
-
getMessage
public String getMessage(String code, Object[] args, String defaultMessage, boolean htmlEscape)
- Specified by:
getMessage
in interfaceIThymeleafRequestContext
-
getMessage
public String getMessage(String code) throws org.springframework.context.NoSuchMessageException
- Specified by:
getMessage
in interfaceIThymeleafRequestContext
- Throws:
org.springframework.context.NoSuchMessageException
-
getMessage
public String getMessage(String code, Object[] args) throws org.springframework.context.NoSuchMessageException
- Specified by:
getMessage
in interfaceIThymeleafRequestContext
- Throws:
org.springframework.context.NoSuchMessageException
-
getMessage
public String getMessage(String code, List<?> args) throws org.springframework.context.NoSuchMessageException
- Specified by:
getMessage
in interfaceIThymeleafRequestContext
- Throws:
org.springframework.context.NoSuchMessageException
-
getMessage
public String getMessage(String code, Object[] args, boolean htmlEscape) throws org.springframework.context.NoSuchMessageException
- Specified by:
getMessage
in interfaceIThymeleafRequestContext
- Throws:
org.springframework.context.NoSuchMessageException
-
getMessage
public String getMessage(org.springframework.context.MessageSourceResolvable resolvable) throws org.springframework.context.NoSuchMessageException
- Specified by:
getMessage
in interfaceIThymeleafRequestContext
- Throws:
org.springframework.context.NoSuchMessageException
-
getMessage
public String getMessage(org.springframework.context.MessageSourceResolvable resolvable, boolean htmlEscape) throws org.springframework.context.NoSuchMessageException
- Specified by:
getMessage
in interfaceIThymeleafRequestContext
- Throws:
org.springframework.context.NoSuchMessageException
-
getErrors
public Optional<org.springframework.validation.Errors> getErrors(String name)
- Specified by:
getErrors
in interfaceIThymeleafRequestContext
-
getErrors
public Optional<org.springframework.validation.Errors> getErrors(String name, boolean htmlEscape)
- Specified by:
getErrors
in interfaceIThymeleafRequestContext
-
getTheme
public org.springframework.ui.context.Theme getTheme()
- Specified by:
getTheme
in interfaceIThymeleafRequestContext
-
getRequestDataValueProcessor
public IThymeleafRequestDataValueProcessor getRequestDataValueProcessor()
- Specified by:
getRequestDataValueProcessor
in interfaceIThymeleafRequestContext
-
getBindStatus
public IThymeleafBindStatus getBindStatus(String path) throws IllegalStateException
- Specified by:
getBindStatus
in interfaceIThymeleafRequestContext
- Throws:
IllegalStateException
-
getBindStatus
public IThymeleafBindStatus getBindStatus(String path, boolean htmlEscape) throws IllegalStateException
- Specified by:
getBindStatus
in interfaceIThymeleafRequestContext
- Throws:
IllegalStateException
-
-