0
저는 다중 모듈 스프링 부트 프로젝트를 개발 중입니다. 내 프로젝트 구조는봄 부팅시 부두 구성
- MyProject를 (부모)
- 프론트 엔드
내가 어떤 가치
- SRC/메인/자원
/자바
- 프론트 엔드
- index.html을 같이
- com.example
- MyWebApp.java
- com.example.config
- WebAppConfig.java
- 나머지
- SRC/주
contextPath
로 설정하고 내 인덱스를 실행할 수 있도록ResourceBase
하는@Bean public JettyServerCustomizer customizeJettyServer() { return new JettyServerCustomizer() { @Override public void customize(final Server server) { ContextHandler frontEndContext = new ContextHandler(); frontEndContext.setContextPath(""); //what should be here frontEndContext.setResourceBase("");//what should be here ResourceHandler frontEndResourceHandler = new ResourceHandler(); frontEndResourceHandler.setWelcomeFiles(new String[] { "index.html" }); frontEndContext.setHandler(frontEndResourceHandler); ContextHandlerCollection contexts = new ContextHandlerCollection(); contexts.setHandlers(new Handler[] { frontEndContext}); server.setHandler(contexts); } }; }
을 다음과 같은
WebAppConfig
에서 빈으로JettyServerCustomizer
을 주입하여 부두를 구성하려고
은 프런트 엔드 모듈에있는 .html? URL은 어떻게 생겼을까요?
감사합니다 :)
'./gradlew bootRun'을 사용하여 응용 프로그램을 실행할 때 true이지만 JAR 배포시 src/main/resources/static 폴더가 아니기 때문에 독립형 jar를 빌드 할 때 정적 내용의 위치를 지정하는 방법 너의 계급에 거기 있니? – user320599
특정 폴더가 classpath에 없지만'static' 폴더와 그 내용은 빌드 시스템이 jar 파일에 포함시키는 것과 같습니다. –