스프링부트

🍀spring/🐛debug

[스프링 부트] intellij localhost:8080/login 연결

스프링 부트 mysql을 연동하던 중 localhost:8080/login에 자꾸 연결되는 오류가 있었어요. 구글링을 해도 oracle db 때문이라고 하는데 저는 오라클 디비를 사용해본적이 없거든요. 정말 답이 없었죠. 그 때, 발견하게 된 오류 메시지 This generated password is for development use only. Your security configuration must be updated before running your application in production. 설마 spring security 때문인가? 그래서 pom.xml에 있는 의존성(저는 maven이라서 그렇고 gradle인 분들은 build.gradle에서 두 개를 주석처리해주세요.) spring ..

🍀spring/스프링 입문

[스프링 웹 개발 기초] 정적 컨텐츠, MVC와 템플릿 엔진, API

정적컨텐츠 : 파일 그대로 고객에게 전달(프로그래밍 불가) static 폴더 안에 html을 만들고 localhost:8080/파일이름.html 하면 html이 나옴 MVC와 템플릿엔진 : 서버에서 변경을 해서 HTML 로 내려줌 @GetMapping("hello-mvc") public String helloMvc(@RequestParam(value="name") String name, Model model){ model.addAttribute("name",name); return "hello-template"; } hello-template.html hello! empty localhost:8080/hello-mvc?name="spring" 파라미터를 입력할 때는 ?를 이용 name을 지정해주지 않으며..

🍀spring/스프링 입문

[View 환경설정] Spring 윈도우 터미널 빌드(자바 버전 맞지 않을 때)

resources 폴더 안에 있는 static 폴더 안에 html 파일을 만들어 주면 그 폴더가 실행된다. 하지만 이는 정적인 움직임이 가능하다. hello.html 안녕하세요. 손님 동적인 것을 만들려면 templates에 폴더 안에 html 파일을 만든다. 자바 파일과 함께 동작시킬 수 있다. 컨트롤러에서(mvc 모델의 컨트롤러) 리턴 값으로 문자를 반환하면 뷰 리롤버가 화면을 찾아서 처리한다. 스트링 부트 템플릿 엔진 ViewName으로 매핑하고 resources : templates/ViewName/ .html로 인식 Controller로 사용할 클래스에는 @Controller를 사용해준다. return hello는 templates안에 있는 hello.html로 인식한다. HelloControl..

pkyung
'스프링부트' 태그의 글 목록