devNyong
스프링 서버 경로 구하기 본문
//getRealPath() : 실제 톰캣이 돌아가고 있는 컴퓨터에서 그 곳의 절대 주소값
String rootPath = request.getSession().getServletContext().getRealPath("/");
//저장경로
1 String uploadPath = rootPath + "upload" ;
2 String uploadPath = request.getServletContext().getRealPath("/upload");
'springboot' 카테고리의 다른 글
[Oracle] mybatis 날짜 조회 (0) | 2022.10.07 |
---|---|
Rest Api Exception 처리 ExceptionAdvice (0) | 2022.05.31 |
[ SpringBoot ] api test , jpa test 코드 (0) | 2022.05.18 |
Comments