https://spring.io/ Spring | HomeCloud Your code, any cloud—we’ve got you covered. Connect and scale your services, whatever your platform.spring.io 시간이 조금 오래 걸리는데 압축으로 풀지 않고, 반디집으로 풀기 !그래서 원하는 경로로 데리고 옴 스프링프레임워크는 자바 11 버전 써여된다 !! 그러면 환경 변수 변경 !! 실행 파일작업할 폴더 만들어주고 워크스페이스 지정 그 다음 해당 경로로 가서메타랑 서버가 생김 xml 넣어주기 그럼 이제 exe 파일 열어서 그럼 프로젝트 생성 완료하지만 에러가 뜨는데 .... 에러가 뜨는데 설정해줘야함 클릭하면펼쳐라 조금 다름 다시 ..
들어가기 전 ! java 에는 패키지, 뷰에는 폴더 !자바빈 작성 방법자바빈은 클래스이기 때문에 기존의 자바 클래스를 작성하는 방법과 동일 !자바빈의 경우 데이터를 담을 프로퍼티(멤버변수)와 데이터를 가져오거나 세팅하는 기능을 하는 메서드로 구성된다package simple;public class Fruit { private String sort; public String getSort() { return sort; } public void setSort(String sort) { this.sort = sort; }} 1. 빈 생성 : fruit 객체 생성 * useBean : 생성도 되지만, 있으면 사용도 됨 * id : java bean 이름, 참조변수, 중복되지 않음 * class: java..
webapp 폴더에 index.jsp , index.html 이 있는 경우 index.html 먼저 실행이 되는데이건 톰캣에 설정되어 있기 때문 ! 기본 설정은 다시 바꿔줄 수 있다 !
매번 한글로 파라미터를 넘겨줄 때 jsp 파일에 해줘야 하는데 필요할 때마다 방식을 넘겨줘야 한다그래서 아예 톰캣에 인코딩 설정하는 것이 좋음 Set Character Encoding org.apache.catalina.filters.SetCharacterEncodingFilter encoding utf-8 Set Character Encoding /* 하고 나서 재실행
1. tomcat 설치https://tomcat.apache.org/download-90.cgi 톰캣이 실행됐는지 확인할라면 ! 아까 포트 번호를 9000으로 해줌 확인이 끝났으면 윈도우에서 시작한 톰캣 중지하기 ! 이제 이클립스에 외장 톰캣으로 넣어줄 것 ! 2. 외장 톰캣 이클립스에 추가하기 잘 가져왔다 ! 처음 설치하고 실행하면 에러가 뜨는데톰캣 더블 클릭하면 아래 화면이 보여질 것 ! 포트번호 9001도 추가 ! 저장 후에프로젝트 생성 생성하면 파일 구조는 이렇게 된다 webapp 에 컨트롤 n 해서 jsp 파일 생성 그러고 톰캣에 마우스 오른쪽을 누르면 add and remove 가 뜰텐데옮겨주면 된다 ! 그리고 이제 실행해주면 컨트롤 f11 실행 끝 !!어휴 힘들어 서블릿 : 작업이 되는..
1. build.gradledependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' // thymeleaf implementation 'org.springframework.boot:spring-boot-starter-web' // Web implementation 'org.springframework.boot:spring-boot-starter-data-jpa' // JPA implementation 'org.springframework.boot:spring-boot-starter-jdbc' // jdbc runtimeOnly 'com.h2database:h2' ..
https://www.h2database.com/html/main.html H2 Database EngineH2 Database Engine Welcome to H2, the Java SQL database. The main features of H2 are: Very fast, open source, JDBC API Embedded and server modes; in-memory databases Browser based Console application Small footprint: around 2.5 MB jar file size Suppwww.h2database.com H2https://www.h2database.com/html/main.htmlJDBC URLjdbc:h2:tcp://l..
MVC - model view controller https://docs.spring.io/spring-boot/reference/web/servlet.html Servlet Web Applications :: Spring BootFor servlet application, Spring Boot includes support for embedded Tomcat, Jetty, and Undertow servers. Most developers use the appropriate “Starter” to obtain a fully configured instance. By default, the embedded server listens for HTTP requests on podocs.spring.io Sp..