栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

UReport2集成SpringBoot-基础配置

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

UReport2集成SpringBoot-基础配置

UReport2集成SpringBoot-基础配置
  • 1. 引入maven依赖
  • 2. 注入UReport2 需要使用到的Servlet,并引入配置文件
  • 3. 配置application.yml
  • 4. 修改报表默认路径
  • 5. 启动SpringBoot项目

1. 引入maven依赖

			org.springframework.boot
			spring-boot-starter
		

		
			org.springframework.boot
			spring-boot-starter-test
			test
		
		
			org.springframework.boot
			spring-boot-starter-web
		
		
			mysql
			mysql-connector-java
			5.1.46
		
		
			org.springframework.boot
			spring-boot-starter-jdbc
		
		
			com.bstek.ureport
			ureport2-console
			2.2.8
		
2. 注入UReport2 需要使用到的Servlet,并引入配置文件
@SpringBootApplication
@importResource("classpath:ureport-console-context.xml")
public class Ureport2DemoApplication {

	public static void main(String[] args) {
		SpringApplication.run(Ureport2DemoApplication.class, args);
	}

	@Bean
	public ServletRegistrationBean buildUreportServlet(){
		return new ServletRegistrationBean(new UReportServlet(), "/ureport/*");
	}
}
3. 配置application.yml
server:
  port: 8081

spring:
  datasource:
    url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&useSSL=false
    username: test
    password: test
    driver-class-name: com.mysql.jdbc.Driver
4. 修改报表默认路径

在resource下创建ureport.properties,文件内容如下

ureport.disableHttpSessionReportCache=true
ureport.disableFileProvider=false
ureport.fileStoreDir=d:/ureport2files
ureport.debug=true
5. 启动SpringBoot项目

访问http://localhost:8081/ureport/designer,出现如下界面则配置成功

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/270750.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号