스프링부트 서블릿
public static void main(String[] args) { ServletWebServerFactory serverFactory = new TomcatServletWebServerFactory(); WebServer webServer = serverFactory.getWebServer(); webServer.start(); } public static void main(String[] args) { ServletWebServerFactory serverFactory = new TomcatServletWebServerFactory(); WebServer webServer = serverFactory.getWebServer(servletContext -> { servletContext.addSe..
2023.02.04
no image
스프링 부트
스프링 부트란? 스프링을 기반으로 동작하는 애플리케이션을 만드는 것 스프링이 오래되서 사라지고 스프링부트를 사용하는게 아니다. 스프링 != 스프링 부트 스프링 부트의 핵심 목표 - 빠르고 광범위한 영역의 스프링 개발 경험 제공 - 프로젝트에서 필요로 하는 다양한 비기능적인 기술 제공 - 코드 생성이나 XML 설정 필요없음 Containerless - Serverless와 유사하다. - Container - web component(servlet)는 web container(servlet container : tomcat)에 있다. - servlet container 다음에 spring container가 있다. Opinionated @RestController를 사용하는 것을 VIEW를 보는게 아니기 때..
2023.02.04
[Spring Boot] Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported
form 태그를 통해서 데이터를 Controller에 전달중에 생긴 이슈 파라미터로 @RequestBody어노테이션을 사용해서 생겼었는데 빼주니 해결 되었다.
2023.01.28
[Spring Boot] Ambiguous mapping. Cannot map 'mainController' method
Ambiguous mapping. Cannot map 'mainController' method @RequestMapping url이 겹치는게 있어서 생긴 이슈이다.
2023.01.27
[Spring Boot] Path with "WEB-INF" or "META-INF" error
Spring Boot를 통해서 프로젝트 첫 세팅을 하는데 아래와 같은 에러가 발생했다. "Path with "WEB-INF" or "META-INF": [WEB-INF/view/index.jsp]" index.jsp를 찾지 못해서 생긴 에러이다. gradle을 사용하는 경우에는 gradle.build > dependencies안에 추가 하자 //jsp implementation 'org.apache.tomcat.embed:tomcat-embed-jasper' implementation 'javax.servlet:jstl'
2023.01.26
Class
function Health(name){ this.name = name; } Health.prototype.showHealth = function(){ console.log(this.name + '님 안녕하세요.'); } const h = new Health('gold'); h.showHealth(); class Health{ constructor(name, lastTime){ this.name = name; this.lastTime = lastTime; } showHealth(){ console.log('안녕하세요.' + this.name); } } const h = new Health('Gold'); h.showHealth(); 겉보기에는 class 이지만 toString.call(Health); 해..
2023.01.26
Arrow Function
let newArr1 = [1,2,3,4,5].map(function(v, i, o){ return v * 2; }) console.log(newArr1); let newArr2 = [1,2,3,4,5].map((v, i, o) => v * 3 ); console.log(newArr2); this context const myObj = { runTimeout(){ setTimeout(function(){ this.printData(); }, 200) }, printData(){ console.log('hihi'); } } myObj.runTimeout(); // error 1. const myObj = { runTimeout(){ setTimeout(function(){ this.printData(); ..
2023.01.26
Template
const data = [ { name : 'coffee bean', order : true, items : ['americano', 'milk'] }, { } ] function fn(tags, name, items){ console.log(tags); if(typeof items === 'undefined'){ items = '주문 가능한 상품이 없습니다.'; } return (tags[0] + name + tags[1] + items + tags[2]); } const template = fn`welcome ${data[0].name} !! 주문가능항목 ${data[1].items}`; console.log(template); const data = [ { name : 'coffee bean', o..
2023.01.26