18 lines
406 B
Java
18 lines
406 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;
|
|
}
|
|
}
|