@PathVariable
·
Framework/SPRING BOOT
http://localhost:8090/app/swagger-ui.html SOAP과 다르게 REST 방식에서는 요청 URL에 어떤 작업할지 내포가 안되기 때문에 method를 통해서 무슨 작업인지를 알려주게 된다. 예> http://localhost:8090/app/name/hong/age/20 값을 얻기 위해서 사용하는게 @PathVariable 어노테이션이고 위 URI에서 20 부분이 @PathVariable로 처리해줄 수 있는 부분이다. 사용법 @GetMapping(" /{변수명}")에 => 꼭 Get이 아니어도 된다. 상관없음. 위에 쓴 변수명을 그대로 @PathVariable("변수명") GET POST & 여러개인 경우 PUT DELETE
Restful 서비스 ( REST 방식 이용한 웹 개발 )
·
Framework/SPRING BOOT
웹 어플리케이션을 개발하는 방식 2가지 1️⃣ SOAP ( Service Oriented Application Programming ) 전통적인 개발 방식 요청: GET방식 : 조회용 ( select ) ⇒ @GetMapping POST방식 : 수정용 (insert, delete, update ) ⇒ @PostMapping 응답: html / jsp ⇒ 웹 브라우저가 필요 ⇒ 화면이 필요 (일반 유저가 보는) 서버에 데이터 전달 방법: query string 예> http://localhost:8090/app/addMember?name=hong&age=20 SOAP은 서로 다른 언어의 플랫폼에서 빌드된 어플리케이션이 서로 통신할 수 있도록 설꼐된 최초의 표준 프로토콜이다. SOAP의 장점은 기존의 원격 ..
@Value
·
Framework/SPRING BOOT
application.properties 에 저장된 key=value 를 빈에서 접근이 가능하다. @Value("${server.port}")
springboot에서 설정 정보 파일
·
Framework/SPRING BOOT
application.properties ( 기본 ) 문법: key=value 예) server.port=8090 application.yml 문법: key: value 예) server: port: 8090
HandlerInterceptor
·
Framework/SPRING BOOT
브라우저 → 필터(Filter) → DispatcherServlet → 인터셉터(preHandle) → Controller | 위임 ← 인터셉터(postHandle) ← ← 인터셉터(afterCompletion) jsp 스프링 프레임워크 의존성 추가 없음 @Component(”xxx”) public class MyHandlerInterceptor extends HandlerInterceptorAdapter {} 필요한 메서드 재정의해서 사용 servlet-context.xml 스프링 부트 의존성 추가 없음 @Component(”xxx”) public class MyHandlerInterceptor implements HandlerInterceptor {} ⇒ 필요한 메서드 재정의해서 사용 왜? defau..
xoo | 수진
xoo의 성장기록