17 lines
386 B
Java
17 lines
386 B
Java
package util;
|
|
|
|
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;
|
|
}
|
|
}
|