
Spring Boot
文章平均质量分 76
fanzhongli
这个作者很懒,什么都没留下…
展开
-
Spring boot中配置H2 database
必须配置datasource才可以看到自己建的表 spring.datasource.url=jdbc:h2:file:~/test spring.datasource.username=sa spring.datasource.password= spring.datasource.driver-class-name=org.h2.Driver ...原创 2017-05-25 11:13:52 · 987 阅读 · 0 评论 -
Spring boot配置多数据源
配置第一个datasource(Primary) /** * Druid数据源配置 */ @Configuration @MapperScan(basePackages = DataSourceConfig.PACKAGE, sqlSessionFactoryRef = "sessionFactory",sqlSessionTemplateRef = "sqlSession...2017-06-26 14:45:48 · 104 阅读 · 0 评论 -
Spring boot 配置array,list,map
myProps: #自定义的属性和值 simpleProp: simplePropValue arrayProps: 1,2,3,4,5 #数组 listProp1: #List<Map<String, String>> - name: abc value: abcValue - name: efg ...原创 2017-07-03 14:41:13 · 618 阅读 · 0 评论 -
在Spring boot中加入web.xml
公司有个项目,有两个子项目,两个独立的工程,我们组用的Spring boot,没有web.xml的,另一个项目组是用的liferay,有liferay6定制的tomcat7,做到中后期,客户说要放在一个tomcat里面,但是spring boot的war包放在liferay的tomcat下报错,特么只好去找怎么在spring boot里面搞个web.xml。。。先在java/webapp/WEB...原创 2017-07-18 17:59:35 · 842 阅读 · 0 评论 -
Spring boot中去掉URL后面的jsessionid
在启动类中继承SpringBootServletInitializer,然后重写这个方法 public void onStartup(ServletContext servletContext) throws ServletException { super.onStartup(servletContext); // This will set to ...原创 2017-07-18 18:04:26 · 1161 阅读 · 0 评论 -
Angular 4 上传多个文件到Spring boot
现在很多项目都使用前后端分离来实现,前后端通过ajax, restful的httpclient来调用,传输数据,以下是angular上传文件到后端JAVA的例子。 <div> <label for="file">Upload file</label> <input id="file" #file type="file" multip2017-11-13 14:10:56 · 326 阅读 · 0 评论 -
Angular 下载zip文件并重命名文件
后端Java代码需要设置response的header,如下 response.setContentType("application/octet-stream; charset=utf8"); response.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_OCTET_STREAM_VALUE); respons...2017-11-14 18:22:52 · 1191 阅读 · 0 评论