皕杰技术社区

 找回密码
 立即加入

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 3279|回复: 13

皕杰报表和springboot的集成

[复制链接]
发表于 2018-10-12 10:49:35 | 显示全部楼层 |阅读模式
一、maven构建项目
1、访问http://start.spring.io/
2、选择构建工具Maven Project、Spring Boot版本2.0.5以及一些工程基本信息,点击“Switch to the full version.”java版本选择8,可参考下图所示:

3、点击Generate Project下载项目压缩包
解压后,使用eclipse,Import -> Existing Maven Projects -> Next ->选择解压后的文件夹-> Finsh,OK done!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即加入

x
 楼主| 发表于 2018-10-12 10:52:06 | 显示全部楼层
二、引入web模块
1、pom.xml中添加支持web的模块:
  1. <dependency>
  2.       <groupId>org.springframework.boot</groupId>
  3.       <artifactId>spring-boot-starter-web</artifactId>
  4. </dependency>
复制代码
pom.xml文件中默认有两个模块:
spring-boot-starter:核心模块,包括自动配置支持、日志和YAML;
spring-boot-starter-test:测试模块,包括JUnit、Hamcrest、Mockito。
2、编写controller内容
  1. @RestController
  2. public class HelloWorldController {
  3.     @RequestMapping("/hello")
  4.     public String index() {
  5.       return "Hello World";
  6.    }
  7. }
复制代码
@RestController的意思就是controller里面的方法都以json格式输出,不用再写什么jackjson配置的了!
启动主程序,打开浏览器访问http://localhost:8080/hello,就可以看到效果了,有木有很简单!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-10-12 11:21:47 | 显示全部楼层
三、皕杰web应用嵌套springboot项目
1、在springboot项目src/main文件夹下创建webapp目录

2、将皕杰报表demoserver/webapps/report下的bios_demo、bios_jsp、bios_web_res、WEB-INF文件夹复制到springboot项目src/main/webapp下

3、更改springboot项目的pom.xml
在<dependencies></dependencies>节点里添加
  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-devtools</artifactId>
  4. <optional>true</optional>
  5. </dependency>
  6. <dependency>
  7. <groupId>javax.servlet</groupId>
  8. <artifactId>jstl</artifactId>
  9. </dependency>
  10. <dependency>  
  11.         <groupId>bijet-license</groupId>  
  12.         <artifactId>bijet-license-sdk</artifactId>  
  13.         <version>1.0</version>  
  14.         <scope>system</scope>  
  15.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/bijet-license.jar</systemPath>  
  16. </dependency>
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即加入

x
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-10-12 11:24:47 | 显示全部楼层
  1. <dependency>  
  2.         <groupId>bios-cos</groupId>  
  3.         <artifactId>bios-cos-sdk</artifactId>  
  4.         <version>1.0</version>  
  5.         <scope>system</scope>  
  6.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/bios-cos.jar</systemPath>  
  7. </dependency>
  8. <dependency>  
  9.         <groupId>bios-cos</groupId>  
  10.         <artifactId>bios-cos-sdk</artifactId>  
  11.         <version>1.0</version>  
  12.         <scope>system</scope>  
  13.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/bios-cos.jar</systemPath>  
  14. </dependency>
  15. <dependency>  
  16.         <groupId>bios-ehcache-1.6.2</groupId>  
  17.         <artifactId>bios-ehcache-1.6.2-sdk</artifactId>  
  18.         <version>1.0</version>  
  19.         <scope>system</scope>  
  20.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/bios-ehcache-1.6.2.jar</systemPath>  
  21. </dependency>
复制代码

回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-10-12 11:30:27 | 显示全部楼层
  1. <dependency>  
  2.         <groupId>bios-iText-2.1.7</groupId>  
  3.         <artifactId>bios-iText-2.1.7-sdk</artifactId>  
  4.         <version>1.0</version>  
  5.         <scope>system</scope>  
  6.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/bios-iText-2.1.7.jar</systemPath>  
  7. </dependency>
  8. <dependency>  
  9.         <groupId>bios-poi-3.9</groupId>  
  10.         <artifactId>bios-poi-3.9-sdk</artifactId>  
  11.         <version>1.0</version>  
  12.         <scope>system</scope>  
  13.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/bios-poi-3.9.jar</systemPath>  
  14. </dependency>  
  15. <dependency>  
  16.         <groupId>bios-poi-ooxml-3.9</groupId>  
  17.         <artifactId>bios-poi-ooxml-3.9-sdk</artifactId>  
  18.         <version>1.0</version>  
  19.         <scope>system</scope>  
  20.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/bios-poi-ooxml-3.9.jar</systemPath>  
  21. </dependency>
复制代码


回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-10-12 14:18:46 | 显示全部楼层
  1. <dependency>  
  2.         <groupId>bios-report</groupId>  
  3.         <artifactId>bios-report-sdk</artifactId>  
  4.         <version>1.0</version>  
  5.         <scope>system</scope>  
  6.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/bios-report.jar</systemPath>  
  7. </dependency>
  8. <dependency>  
  9.         <groupId>dom4j-1.6.1</groupId>  
  10.         <artifactId>dom4j-1.6.1-sdk</artifactId>  
  11.         <version>1.0</version>  
  12.         <scope>system</scope>  
  13.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/dom4j-1.6.1.jar</systemPath>  
  14. </dependency>
  15. <dependency>  
  16.         <groupId>commons-logging-1.0.4</groupId>  
  17.         <artifactId>commons-logging-1.0.4-sdk</artifactId>  
  18.         <version>1.0</version>  
  19.         <scope>system</scope>  
  20.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/commons-logging-1.0.4.jar</systemPath>  
  21. </dependency>
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-10-12 14:20:25 | 显示全部楼层
  1. <dependency>  
  2.         <groupId>iTextAsian</groupId>  
  3.         <artifactId>iTextAsian-sdk</artifactId>  
  4.         <version>1.0</version>  
  5.         <scope>system</scope>  
  6.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/iTextAsian.jar</systemPath>  
  7. </dependency>
  8. <dependency>  
  9.         <groupId>javax.wsdl_1.5.1.v200806030408</groupId>  
  10.         <artifactId>javax.wsdl_1.5.1.v200806030408-sdk</artifactId>  
  11.         <version>1.0</version>  
  12.         <scope>system</scope>  
  13.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/javax.wsdl_1.5.1.v200806030408.jar</systemPath>  
  14. </dependency>
  15. <dependency>  
  16.         <groupId>javax.xml_1.3.4.v200902170245</groupId>  
  17.         <artifactId>javax.xml_1.3.4.v200902170245-sdk</artifactId>  
  18.         <version>1.0</version>  
  19.         <scope>system</scope>  
  20.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/javax.xml_1.3.4.v200902170245.jar</systemPath>  
  21. </dependency>
复制代码


回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-10-12 15:00:05 | 显示全部楼层
  1. <dependency>  
  2.         <groupId>org.apache.xerces_2.9.0.v200909240008</groupId>  
  3.         <artifactId>org.apache.xerces_2.9.0.v200909240008-sdk</artifactId>  
  4.         <version>1.0</version>  
  5.         <scope>system</scope>  
  6.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/org.apache.xerces_2.9.0.v200909240008.jar</systemPath>  
  7. </dependency>
  8. <dependency>  
  9.         <groupId>poi-ooxml-schemas-3.9-20121203</groupId>  
  10.         <artifactId>poi-ooxml-schemas-3.9-20121203-sdk</artifactId>  
  11.         <version>1.0</version>  
  12.         <scope>system</scope>  
  13.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/poi-ooxml-schemas-3.9-20121203.jar</systemPath>  
  14. </dependency>
  15. <dependency>  
  16.         <groupId>stax-api-1.0.1</groupId>  
  17.         <artifactId>stax-api-1.0.1-sdk</artifactId>  
  18.         <version>1.0</version>  
  19.         <scope>system</scope>  
  20.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/stax-api-1.0.1.jar</systemPath>  
  21. </dependency>
复制代码


回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-10-12 15:02:02 | 显示全部楼层
  1. <dependency>  
  2.         <groupId>xmlbeans-2.3.0</groupId>  
  3.         <artifactId>xmlbeans-2.3.0-sdk</artifactId>  
  4.         <version>1.0</version>  
  5.         <scope>system</scope>  
  6.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/xmlbeans-2.3.0.jar</systemPath>  
  7. </dependency>
  8. <dependency>  
  9.         <groupId>server</groupId>  
  10.         <artifactId>server-sdk</artifactId>  
  11.         <version>1.0</version>  
  12.         <scope>system</scope>  
  13.         <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/server.jar</systemPath>  
  14. </dependency>
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2018-10-12 15:04:31 | 显示全部楼层
在<build></build>节点里添加
  1. <resources>
  2.         <resource>
  3.                 <directory>src/main/webapp/WEB-INF/resources</directory>
  4.                 <includes>
  5.                         <include>**/*.properties</include>
  6.                         <include>**/*.yml</include>
  7.                         <include>**/*.xml</include>
  8.                         <include>**/*.tld</include>
  9.                        
  10.                 </includes>
  11.                 <filtering>false</filtering>
  12.         </resource>
  13. </resources>
复制代码
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即加入

本版积分规则

QQ|小黑屋|手机版|皕杰软件 ( 京ICP备14050931号 )

GMT+8, 2024-5-3 18:33 , Processed in 1.201233 second(s), 17 queries .

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表