springboot freemarker 和 jsp 混合使用

最近在学习springboot,使用前台框架freemarker 和 jsp  混合使用,且打包成war,学习打标

pom.xml

war


   org.springframework.boot
   spring-boot-starter-freemarker


   javax.servlet
   javax.servlet-api
   3.1.0


   commons-lang
   commons-lang
   2.6


   javax.servlet
   jstl


   org.apache.tomcat
   tomcat-juli
   8.5.41


   org.apache.tomcat.embed
   tomcat-embed-jasper
   8.5.41
   provided
   
      
         tomcat-embed-core
         org.apache.tomcat.embed
      
      
         tomcat-embed-el
         org.apache.tomcat.embed
      
   
   


   org.apache.tomcat.embed
   tomcat-embed-core
   8.5.41
   
      
         tomcat-annotations-api
         org.apache.tomcat
      
   


   org.apache.tomcat
   tomcat-annotations-api
   8.5.41


   org.apache.tomcat.embed
   tomcat-embed-core
   8.5.41
   
      
         tomcat-annotations-api
         org.apache.tomcat
      
   


   org.apache.tomcat.embed
   tomcat-embed-el
   8.5.41

   org.springframework.boot
   spring-boot-maven-plugin

 

#spring mvc 要修改默认目录,web-inf
spring:
  mvc:
    view:
      prefix: /WEB-INF/
  freemarker:
    template-loader-path: /WEB-INF/
//需要继承SpringBootServletInitializer,当用wildfly容器时需要初始化servlet
@SpringBootApplication
public class BootApplication  extends SpringBootServletInitializer{
   @Override
   protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
      return application.sources(BootApplication.class);
   }
   public static void main(String[] args) {
      SpringApplication.run(BootApplication.class, args);
   }

}

springboot freemarker 和 jsp 混合使用_第1张图片

目录结构
springboot freemarker 和 jsp 混合使用_第2张图片

 

 

 

 

 

 

你可能感兴趣的:(springboot)