catch와return
793 단어 DAO
try {
String oid = abc.getId();
ABC abc = service.get(oid);// service DAO , DAOException
request.setAttribute("abc", abc);
} catch (DAOException e) {
logger.error(e.getMessage());
request.setAttribute("message", "!@#$");
return mapping.findForward("error");
} catch (Exception e) {
logger.error(e.getMessage());
e.printStackTrace();
request.setAttribute("message", "!@#$");
return mapping.findForward("error");
}
DAO에 이상이 생기면 첫 번째catch 블록에서 이상이 끝나고 두 번째catch 블록에 잡히지 않습니다
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Spring에서 DAO가 순환 호출될 때 데이터가 실시간으로 업데이트되지 않는 해결 방법문제를 설명하기 전에 몇 가지 전제 사항을 설명하십시오. Spring의 구성 파일에서 다음과 같은 방식으로 데이터베이스 트랜잭션을 구성했다고 가정하십시오. 현재 UserDao 및 Security Service가 있습...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.