我有一個webapp(與spring-mvc和thymeleaf)和一個模塊(spring-mvc),但是這個模塊在2個不同的團隊之間共享,是否可以在這個模塊中放置一些html文件然後從我的webapp解析這個視圖?如果是這樣怎麼辦?從另一個項目彈簧導入視圖
請看以下JavaConfig文件:
@Configuration
@ComponentScan(basePackageClasses = {PortalApplication.class}, includeFilters = @Filter(Controller.class), useDefaultFilters = false)
class WebMvcConfig extends WebMvcConfigurationSupport {
private static final String MESSAGE_SOURCE = "/WEB-INF/i18n/messages";
private static final String VIEWS = "/WEB-INF/views/";
private static final String RESOURCES_LOCATION = "/resources/";
private static final String IMAGES_LOCATION = "/resources/images";
private static final String RESOURCES_HANDLER = RESOURCES_LOCATION + "**";`
...
@Bean
public TemplateResolver templateResolver() {
TemplateResolver templateResolver = new ServletContextTemplateResolver();
templateResolver.setPrefix(VIEWS);
templateResolver.setSuffix(".html");
templateResolver.setTemplateMode("HTML5");
templateResolver.setCacheable(false);
templateResolver.setCharacterEncoding("UTF-8");
return templateResolver;
}`
,但我無法弄清楚如何將其他項目的相對路徑添加到一個新的解析器
我有點丟在這裏,需要這樣的幫助,非常感謝,很多公司...