gpt4 book ai didi

java - 按 F5 键后 Vaadin 8.3 session 失败

转载 作者:行者123 更新时间:2023-12-01 16:50:26 25 4
gpt4 key购买 nike

我在 vaadin session 中使用 Jwt,当按 F5 时出现问题 Error Page

 private void onLogin(LoginForm.LoginEvent loginEvent) {
String enteredUsername = loginEvent.getLoginParameter("username");
String enteredPassword = loginEvent.getLoginParameter("password");

AuthenticationResponse response = apiExecutorService.doAdminAuthentication(enteredUsername, enteredPassword);

if (response != null && StringUtils.isNotBlank(response.getAccessToken())) {
// Put token into session params
String test = response.getAccessToken();
VaadinSession.getCurrent().setAttribute("access_token", response.getAccessToken());
VaadinSession.getCurrent().setAttribute("refresh_token", response.getRefreshToken());

Notification...

// Wait and redirect to admin page
Page current = Page.getCurrent();
notification.addDetachListener(event -> current.setLocation("/admin"));

最佳答案

你可以使用这个拐杖:

addShortcutListener(new ShortcutListener("刷新", ShortcutAction.KeyCode.F5, null) {
@覆盖
公共(public)无效handleAction(对象发送者,对象目标){
刷新网格();
}
});

关于java - 按 F5 键后 Vaadin 8.3 session 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61700995/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com