Erweiterungen
This commit is contained in:
19
src/main/java/util/Util.java
Normal file
19
src/main/java/util/Util.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package util;
|
||||
|
||||
import com.vaadin.flow.component.UI;
|
||||
import com.vaadin.flow.component.applayout.AppLayout;
|
||||
import com.vaadin.flow.server.VaadinSession;
|
||||
import com.vaadin.flow.server.WrappedSession;
|
||||
|
||||
|
||||
public class Util {
|
||||
public static String getSessionAttributeWithDefault(WrappedSession currentSession, String key, String defaultValue) {
|
||||
var result = defaultValue;
|
||||
|
||||
try {
|
||||
result = currentSession.getAttribute(key).toString();
|
||||
} catch (Exception e) {}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user