Spring-Boot using JSP's from dependent jar

133 Views Asked by At

I am attempting to set up two separate spring boot applications. There are a few jsp's that would be nice to share between the two rather than having duplicates. The projects are already sharing a common jar. Is there a way that I can include the jsp's in the common jar?

I have tried putting them in the /WEB-INF/jsp within the shared jar with no luck.

This is how my View Resolver is setup right now:

@Bean
public ViewResolver getViewResolver() {
    InternalResourceViewResolver resolver = new InternalResourceViewResolver();
    resolver.setPrefix("/WEB-INF/jsp");
    resolver.setSuffix(".jsp");
    return resolver;
}
1

There are 1 best solutions below

1
Ihor Horovyi On

Add properties in application.properties file: spring.mvc.view.prefix: /WEB-INF/jsp/ spring.mvc.view.suffix: .jsp