Package com.vaadin.flow.server
Class SystemMessages
- java.lang.Object
-
- com.vaadin.flow.server.SystemMessages
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CustomizedSystemMessages
public class SystemMessages extends Object implements Serializable
Contains the system messages used to notify the user about various critical situations that can occur.Use
VaadinService.setSystemMessagesProvider(SystemMessagesProvider)
to customize.The defaults defined in this class are:
- sessionExpiredURL = null
- sessionExpiredNotificationEnabled = false
- sessionExpiredCaption = "Session Expired"
- sessionExpiredMessage = "Take note of any unsaved data, and click here or press ESC key to continue."
- internalErrorURL = null
- internalErrorNotificationEnabled = true
- internalErrorCaption = "Internal error"
- internalErrorMessage = "Please notify the administrator. Take note of any unsaved data, and click here or press ESC to continue."
- cookiesDisabledURL = null
- cookiesDisabledNotificationEnabled = true
- cookiesDisabledCaption = "Cookies disabled"
- cookiesDisabledMessage = "This application requires cookies to function. Please enable cookies in your browser and click here or press ESC to try again.
- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
cookiesDisabledCaption
protected String
cookiesDisabledMessage
protected boolean
cookiesDisabledNotificationEnabled
protected String
cookiesDisabledURL
protected String
internalErrorCaption
protected String
internalErrorMessage
protected boolean
internalErrorNotificationEnabled
protected String
internalErrorURL
protected String
sessionExpiredCaption
protected String
sessionExpiredMessage
protected boolean
sessionExpiredNotificationEnabled
protected String
sessionExpiredURL
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCookiesDisabledCaption()
Gets the caption to show in a "cookies disabled" notification.String
getCookiesDisabledMessage()
Gets the message to show in a "cookies disabled" notification.String
getCookiesDisabledURL()
Gets the URL the user will be redirected to after dismissing a "cookies disabled" message.String
getInternalErrorCaption()
Gets the caption to show in an "internal error" notification.String
getInternalErrorMessage()
Gets the message to show in a "internal error" notification.String
getInternalErrorURL()
Gets the URL the user will be redirected to after dismissing an internal error message.String
getSessionExpiredCaption()
Gets the caption to show in a "session expired" notification.String
getSessionExpiredMessage()
Gets the message to show in a "session expired" notification.String
getSessionExpiredURL()
Gets the URL the user will be redirected to after dismissing a session expired message.boolean
isCookiesDisabledNotificationEnabled()
Checks if "cookies disabled" notifications should be shown to the end user.boolean
isInternalErrorNotificationEnabled()
Checks if "internal error" notifications should be shown to the end user.boolean
isSessionExpiredNotificationEnabled()
Checks if "session expired" notifications should be shown to the end user.
-
-
-
Field Detail
-
sessionExpiredURL
protected String sessionExpiredURL
-
sessionExpiredNotificationEnabled
protected boolean sessionExpiredNotificationEnabled
-
sessionExpiredCaption
protected String sessionExpiredCaption
-
sessionExpiredMessage
protected String sessionExpiredMessage
-
internalErrorURL
protected String internalErrorURL
-
internalErrorNotificationEnabled
protected boolean internalErrorNotificationEnabled
-
internalErrorCaption
protected String internalErrorCaption
-
internalErrorMessage
protected String internalErrorMessage
-
cookiesDisabledURL
protected String cookiesDisabledURL
-
cookiesDisabledNotificationEnabled
protected boolean cookiesDisabledNotificationEnabled
-
cookiesDisabledCaption
protected String cookiesDisabledCaption
-
cookiesDisabledMessage
protected String cookiesDisabledMessage
-
-
Method Detail
-
getSessionExpiredURL
public String getSessionExpiredURL()
Gets the URL the user will be redirected to after dismissing a session expired message. Default value is null.- Returns:
- the URL to redirect to, or null to refresh the page
-
isSessionExpiredNotificationEnabled
public boolean isSessionExpiredNotificationEnabled()
Checks if "session expired" notifications should be shown to the end user. If the notification is disabled the user will be immediately redirected to the URL returned bygetSessionExpiredURL()
. By default, the "session expired" notification is disabled.- Returns:
true
to show the notification to the end user,false
to redirect directly
-
getSessionExpiredCaption
public String getSessionExpiredCaption()
Gets the caption to show in a "session expired" notification. Returns null if the "session expired" notification is disabled.- Returns:
- The caption to show or
null
to show no caption.
-
getSessionExpiredMessage
public String getSessionExpiredMessage()
Gets the message to show in a "session expired" notification. Returns null if the "session expired" notification is disabled.- Returns:
- The message to show or
null
to show no message.
-
getInternalErrorURL
public String getInternalErrorURL()
Gets the URL the user will be redirected to after dismissing an internal error message. Default value is null.- Returns:
- the URL to redirect to, or null to refresh the page
-
isInternalErrorNotificationEnabled
public boolean isInternalErrorNotificationEnabled()
Checks if "internal error" notifications should be shown to the end user. If the notification is disabled the user will be immediately redirected to the URL returned bygetInternalErrorURL()
. By default, the "internal error" notification is enabled.- Returns:
true
to show the notification to the end user,false
to redirect directly
-
getInternalErrorCaption
public String getInternalErrorCaption()
Gets the caption to show in an "internal error" notification. Returns null if the "internal error" notification is disabled.- Returns:
- The caption to show or
null
to show no caption.
-
getInternalErrorMessage
public String getInternalErrorMessage()
Gets the message to show in a "internal error" notification. Returns null if the "internal error" notification is disabled.- Returns:
- The message to show or
null
to show no message.
-
getCookiesDisabledURL
public String getCookiesDisabledURL()
Gets the URL the user will be redirected to after dismissing a "cookies disabled" message. Default value is null.- Returns:
- the URL to redirect to, or null to refresh the page
-
isCookiesDisabledNotificationEnabled
public boolean isCookiesDisabledNotificationEnabled()
Checks if "cookies disabled" notifications should be shown to the end user. If the notification is disabled the user will be immediately redirected to the URL returned bygetCookiesDisabledURL()
. By default, the "cookies disable" notification is disabled.- Returns:
true
to show the notification to the end user,false
to redirect directly
-
getCookiesDisabledCaption
public String getCookiesDisabledCaption()
Gets the caption to show in a "cookies disabled" notification. Returns null if the "cookies disable" notification is disabled.- Returns:
- The caption to show or
null
to show no caption.
-
getCookiesDisabledMessage
public String getCookiesDisabledMessage()
Gets the message to show in a "cookies disabled" notification. Returns null if the "cookies disable" notification is disabled.- Returns:
- The message to show or
null
to show no message.
-
-