fix: 로그아웃 후 재 로그아웃 시 에러나는 부분 조치

main
thkim 2024-07-17 09:34:50 +09:00
parent 8ff2bb54e2
commit f47a6b6e16
4 changed files with 21 additions and 7 deletions

1
open_builded.bat Normal file
View File

@ -0,0 +1 @@
explorer C:\Users\dbnt\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\geoinfo_eGov_work

View File

@ -524,11 +524,21 @@ public class LoginController {
String userId = (String)request.getSession().getAttribute("USERID"); String userId = (String)request.getSession().getAttribute("USERID");
users.remove(userId, request.getSession());
RequestContextHolder.getRequestAttributes().removeAttribute(userId, RequestAttributes.SCOPE_SESSION); if( userId == null ) {
System.out.println(
request.getSession().invalidate(); "\n--------------------------------------------------------------\n" +
request.getRequestURI() + " " + " userId == null: 이미 로그아웃되어있음." +
"\n--------------------------------------------------------------\n" +
"userId:[" + "null" + "]\n" +
"\n--------------------------------------------------------------\n"
);
mv.setViewName("/");
} else {
users.remove(userId, request.getSession());
RequestContextHolder.getRequestAttributes().removeAttribute(userId, RequestAttributes.SCOPE_SESSION);
request.getSession().invalidate();
}
return mv; return mv;
} }

View File

@ -968,8 +968,11 @@ public class MainController
} catch (SQLException e) { } catch (SQLException e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
if (false && !e.getMessage().contains("Already closed")) { if (true && e.getMessage().contains("Already closed")) {
// "Already closed" 예외가 아닌 경우에만 처리 System.out.println("Already closed");
} else if (true && e.getMessage().contains("Socket read timed out")) {
System.out.println("데이터베이스 연결 시간 초과");
} }
throw e; throw e;

Binary file not shown.