springboot + jsp

来源:互联网 发布:美国历史书籍推荐 知乎 编辑:程序博客网 时间:2024/04/29 04:10
# IDENTITY (ContextIdApplicationContextInitializer)spring.application.index=SpringBootWelcome.v1.1spring.application.name=SpringBootWelcome#Serverserver.port=80server.jsp-servlet.class-name=org.apache.jasper.servlet.JspServletsecurity.basic.enabled=falsemanagement.security.enabled=false#MVCspring.mvc.view.prefix=/WEB-INF/views/security.basic.enabled=falsemanagement.security.enabled=false#LOGlogging.config=classpath:log4j2.xml
package com.lance.welcome.config;import org.springframework.context.annotation.Configuration;import org.springframework.core.Ordered;import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;@Configurationpublic class WebMvcConfigure extends WebMvcConfigurerAdapter{@Overridepublic void addViewControllers(ViewControllerRegistry registry) {registry.addViewController("/").setViewName("forward:/index.jsp");registry.setOrder(Ordered.HIGHEST_PRECEDENCE);super.addViewControllers(registry);}}
package com.lance.welcome;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplicationpublic class SimpleApplication {public static void main(String[] args) {SpringApplication.run(SimpleApplication.class, args);}}

原创粉丝点击