Package com.morpheusdata.core.web
Interface MorpheusWebRequestService
public interface MorpheusWebRequestService
Provides accessor methods for some common servlet Request attributes.
NOTE: This should ONLY be used in
UIExtensionProvider
based providers
It will fail in other scenarios. A common use case for this accessor is to grab the nonce token for injecting
stylesheets and javascript into custom views-
Method Summary
Modifier and TypeMethodDescriptionReturns the locale of the current request.getMessage
(String code, Object[] args, String defaultMessage, Locale locale) Returns the i18n generated message based on the passed in code.getMessage
(String code, Object[] args, Locale locale) Returns the i18n result message based on the passed in codeGets the current request Nonce Token Attribute for use in injecting javascript/stylesheets
-
Method Details
-
getNonceToken
String getNonceToken()Gets the current request Nonce Token Attribute for use in injecting javascript/stylesheets- Returns:
- the nonce token
-
getLocale
Locale getLocale()Returns the locale of the current request. Often used in helpers for the renderer when localizing strings- Returns:
- the current request locale (if available in the thread context)
-
getMessage
Returns the i18n result message based on the passed in code- Parameters:
code
-args
-locale
-- Returns:
-
getMessage
Returns the i18n generated message based on the passed in code. If the i18n property is not found, a default message can be passed- Parameters:
code
-args
-defaultMessage
-locale
-- Returns:
-