spring boot 加载jsp
1、spring boot启动类继承SpringBootServletInitializer ,并且重写configure方法
package com.springapp.mvc;import javax.servlet.MultipartConfigElement; @SpringBootApplication
@ImportResource({"classpath:config/applicationContext-xweb.xml"})
@ComponentScan
public class XwebApplication extends SpringBootServletInitializer { public static void main(String[] args) {
SpringApplication springApplication =new SpringApplication(XwebApplication.class);
springApplication.run(args);
} @Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(XwebApplication.class);
} /**
* 上传附件容量限制
* @return
*/
@Bean
public MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
factory.setMaxFileSize("102400KB");
factory.setMaxRequestSize("112400KB");
return factory.createMultipartConfig();
} }
2、pom.xml
增加spring-boot插件, 以及tomcat-embed-jasper依赖。
<!-- 使用Jasper引擎解析JSP -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency> <build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
3、用spring-boot插件启动

spring boot 加载jsp的更多相关文章
- Spring Boot加载配置文件
问题1:Spring如何加载配置,配置文件位置? 1.默认位置: Spring Boot默认的配置文件名称为application.properties,SpringApplication将从以下位置 ...
- Spring Boot加载application.properties配置文件顺序规则
SpringApplication会从以下路径加载所有的application.properties文件: 1.file:./config/(当前目录下的config文件夹) 2.file:./(当前 ...
- spring boot 加载web容器tomcat流程源码分析
spring boot 加载web容器tomcat流程源码分析 我本地的springboot版本是2.5.1,后面的分析都是基于这个版本 <parent> <groupId>o ...
- Spring boot加载REACTIVE源码分析
一,加载REACTIVE相关自动配置 spring boot通过判断含org.springframework.web.reactive.DispatcherHandler字节文件就确定程序类型是REA ...
- spring boot 加载自定义log4j 文件路径
spring boot 使用log4j 打印时,需首先去除自带 Logger ,然后加入log4j 依赖 <dependencies> <!-- https://mvnreposit ...
- spring boot 加载配置 文件
在springboot启动的过程中,默契情况下会在classpath路径下加载application.properties当做系统配置文件,但有时候我们想要替换成另一个文件,可以 通过以下方式: ...
- spring boot加载自定义配置
1.通过@Value 配置文件中 wechat: ssh: host: 192.0.1.1 port: 22 加载类 @Component @Data public class SftpConfig ...
- spring Boot加载bean
1.SpringBoot中加载bean,可以使用注解@compenent直接加载到applicationContext容器中 2.在直接类@Configuration中,手动注册bean,如:
- spring boot 加载原理
spring boot quick start 在springBoot里面,很吸引的一个特征就是可以直接把应用打包成jar/war包形式.然后jar/war包可以直接运行的.不需要再配置web Ser ...
随机推荐
- js解决跨站点脚本编制问题
1.前台处理(容易绕过): <script type="text/javascript"> $(document).ready(function(){ var url= ...
- Mysql时间存储类型优缺点?DATETIME?TIMESTAMP?INT?
TIMESTAMP 4个字节储存;值以UTC格式保存;.时区转化 ,存储时对当前的时区进行转换,检索时再转换回当前的时区. DATETIME 8个字节储存;实际格式储存;与时区无关;datetime ...
- C++之虚析构函数
代码一. #include <iostream> using namespace std; class Base { public: Base(){}; ~Base() { cout &l ...
- 在sql结果中显示行号
1.准备 create table newtable ( name ), ) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ); ); ); ); ); 2.实现 ) a ...
- 纯css3实现的鼠标悬停动画按钮
今天给大家带来一款纯css3实现的鼠标悬停动画按钮.这款按钮鼠标经过前以正方形的形式,当鼠标经过的时候以动画的形式变成圆形.效果图如下: 在线预览 源码下载 实现的代码. html代码: < ...
- 数字集成电路设计-14-DPI
引言 在进行IC验证时,尤其是规模较大的时候,单纯用Verilog和SV来构建testbench.可能会稍显吃力. 在这样的情况下,使用C或者C++等软件语言往往会大大加快验证速度,提高验证效率. P ...
- 文件模式设置用户ID/设置组ID/sticky bit_转
S_ISUID (04000) set-user-ID (set process effective user ID on execve(2))S_ISGID (02000) set-grou ...
- RabbitMQ之远程过程调用(RPC)【译】
在第二个教程中,我们学习了如何使用工作队列在多个worker之间分配耗时的任务. 但是如果我们需要在远程计算机上运行功能并等待结果呢?嗯,这是另外一件事情,这种模式通常被称为远程过程调用(RPC). ...
- Scala中List(Map1,Map2,Map3 ....) 转成一个Map
这个问题研究好久...头大,不记得有fold用法了. fold函数:折叠,提供一个输入参数作为初始值,然后大括号中应用自定义fun函数并返回值. list.fold(Map()){(x,y)=> ...
- libcurl库的编译
终于弄懂了libcurl库的编译,记下来免得忘记. 下载地址: libcurl库:http://curl.haxx.se/latest.cgi?curl=zip openssl安装包:http ...