일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
- vscode
- web.xml
- profile
- bash
- port
- netsh
- Eclipse
- Windows 10
- xargs
- grep
- 네트워크
- find
- JavaScript
- context
- Source
- Quartz
- maVen
- plugin
- ssh
- lsof
- 줄바꿈 문자
- 단축키
- IntelliJ
- VirtualBox
- resource
- tomcat
- Windows
- Mac
- GIT
- import
- Today
- Total
목록Dev/Spring Boot (12)
develog
프로젝트 루트에 Dockerfile 만들기 # Dockerfile FROM openjdk:11 ARG JAR_FILE=build/libs/*.jar COPY ${JAR_FILE} app.jar ENTRYPOINT ["java", "-jar", "/app.jar"] docker 이미지 만들기 docker build -t myapp:1.0 . # 이미지 확인 docker images docker 컨테이너 실행 docker run -d -p 8080:8080 --name myapp myapp:1.0 # 컨테이너 확인 docker ps 실행 확인 http://localhost:8080
ClassPathResource File file = new ClassPathResource("static/findMe.txt").getFile(); ResourceLoader @Autowired ResourceLoader resourceLoader; File file = resourceLoader.getResource("classpath:static/findMe.txt").getFile(); ResourceUtils File file = ResourceUtils.getFile("classpath:static/findMe.txt");
@SpringBootTest @AutoConfigureMockMvc
application.yml 을 설정한다 spring: datasource: driver-class-name: org.h2.Driver url: jdbc:h2:mem:testdb username: sa password: h2: console: enabled: true path: /h2-console 애플리케이션을 실행하고 브라우저에서 접속한다 http://localhost:8080/h2-console
file 경로 src/main/resources/static/readme11.txt controller @Controller public class MyController { @Autowired private ResourceLoader resourceLoader; @RequestMapping(value = "/hello") public String hello() throws Exception { File file = null; ClassPathResource cpr = new ClassPathResource("static/readme11.txt"); System.out.println("11, " + cpr.exists() + ", " + cpr.getPath()); Resource resource = r..
build.gradle compileOnly 'org.apache.tomcat.embed:tomcat-embed-jasper' compileOnly 'javax.servlet:jstl:1.2' application.properties spring.mvc.view.prefix=/WEB-INF/jsp/ spring.mvc.view.suffix=.jsp jsp 파일 위치 src/main/webapp/WEB-INF/jsp/hello.jsp Refresh Gradle Project eclipe > project properties > Refresh Gradle Project