Browse Source

修改数据源配置,尝试解决获取数据库连接时偶尔卡顿的情况;解决直接打印的情况下缩放页面时出现加载动画的bug;

sunyj 9 years ago
parent
commit
efa7747524

+ 18 - 9
src/main/java/com/uas/report/controller/PrintController.java

@@ -71,9 +71,6 @@ public class PrintController {
 	@RequestMapping("")
 	public void print(String userName, String profile, String reportName, String whereCondition, String otherParameters,
 			String printType, HttpServletRequest request, HttpServletResponse response) {
-		logger.info(new StringBuilder("ip=").append(IpHelper.getIp(request)).append(", userName=").append(userName)
-				.append(", reportName=").append(reportName).append(", whereCondition=").append(whereCondition)
-				.append(", otherParameters=").append(otherParameters));
 		// printType为空,默认进入预览页
 		if (StringUtils.isEmpty(printType)) {
 			printType = ReportConstants.PREVIEW_PRINT_TYPE;
@@ -91,13 +88,13 @@ public class PrintController {
 		// 下载pdf、纯数据excel
 		else if (printType.equals(ReportConstants.PDF_PRINT_TYPE)) {
 			export(userName, profile, reportName, whereCondition, otherParameters, ReportConstants.PDF_FILE_TYPE,
-					response);
+					request, response);
 		}
 		// 该下载接口供UAS系统使用,应其要求,EXCEL_PRINT_TYPE只能为EXCEL(该值意思本应为下载全部数据的excel),
 		// 导致与EXCEL_WITH_ONLY_DATA_FILE_TYPE(下载纯数据的excel)命名不相匹配
 		else if (printType.equals(ReportConstants.EXCEL_PRINT_TYPE)) {
 			export(userName, profile, reportName, whereCondition, otherParameters,
-					ReportConstants.EXCEL_WITH_ONLY_DATA_FILE_TYPE, response);
+					ReportConstants.EXCEL_WITH_ONLY_DATA_FILE_TYPE, request, response);
 		} else {
 			throw new ReportException("printType不合法");
 		}
@@ -119,12 +116,16 @@ public class PrintController {
 	 *            JSON格式,数据为键值对
 	 * @param exportFileType
 	 *            报表导出的格式,默认为pdf
+	 * @param request
 	 * @param response
 	 */
 	@RequestMapping("/export")
 	@ResponseBody
 	public void export(String userName, String profile, String reportName, String whereCondition,
-			String otherParameters, String exportFileType, HttpServletResponse response) {
+			String otherParameters, String exportFileType, HttpServletRequest request, HttpServletResponse response) {
+		logger.info(new StringBuilder("ip=").append(IpHelper.getIp(request)).append(", userName=").append(userName)
+				.append(", reportName=").append(reportName).append(", whereCondition=").append(whereCondition)
+				.append(", otherParameters=").append(otherParameters));
 		ReportUtils.checkParameters(userName, reportName);
 
 		logger.info("开始导出报表:" + userName + "/" + reportName);
@@ -146,7 +147,7 @@ public class PrintController {
 		if (!fileService.isFileValid(file.getPath(), fileService.getJrxmlFilePath(userName, reportName))) {
 			data = printService.export(userName, profile, reportName, whereCondition, otherParameters, exportFileType);
 			if (ArrayUtils.isEmpty(data)) {
-				throw new ReportException("报表导出失败:" + userName + "/" + reportName);
+				throw new ReportException("报表导出失败:" + userName + "/" + reportName + "\n");
 			}
 			FileUtils.create(file.getPath(), data);
 		} else {
@@ -203,14 +204,18 @@ public class PrintController {
 	 *            JSON格式,数据为键值对
 	 * @param pageIndex
 	 *            分页展示,当前页码,从0开始
+	 * @param request
 	 * @param response
 	 * @return 包括pageSize、pdfPath
 	 */
 	@RequestMapping(value = "/loadPdfData")
 	@ResponseBody
 	public Map<String, Object> loadPdfData(final String userName, final String profile, final String reportName,
-			final String whereCondition, final String otherParameters, Integer pageIndex,
+			final String whereCondition, final String otherParameters, Integer pageIndex, HttpServletRequest request,
 			HttpServletResponse response) {
+		logger.info(new StringBuilder("ip=").append(IpHelper.getIp(request)).append(", userName=").append(userName)
+				.append(", reportName=").append(reportName).append(", whereCondition=").append(whereCondition)
+				.append(", otherParameters=").append(otherParameters));
 		ReportUtils.checkParameters(userName, reportName);
 		logger.info("开始预览报表:" + userName + "/" + reportName);
 		Map<String, Object> result = new HashMap<>();
@@ -278,12 +283,16 @@ public class PrintController {
 	 *            JSON格式,数据为键值对
 	 * @param fileType
 	 *            文件格式,pdf、xls、xls_with_only_data
+	 * @param request
 	 * @return 文件的信息
 	 */
 	@RequestMapping(value = "/getGeneratedPdfOrXlsInformation")
 	@ResponseBody
 	public Map<String, Object> getGeneratedPdfOrXlsInformation(String userName, String profile, String reportName,
-			String whereCondition, String otherParameters, String fileType) {
+			String whereCondition, String otherParameters, String fileType, HttpServletRequest request) {
+		logger.info(new StringBuilder("ip=").append(IpHelper.getIp(request)).append(", userName=").append(userName)
+				.append(", reportName=").append(reportName).append(", whereCondition=").append(whereCondition)
+				.append(", otherParameters=").append(otherParameters));
 		Map<String, Object> result = new HashMap<>();
 		if (StringUtils.isEmpty(fileType)) {
 			fileType = ReportConstants.PDF_FILE_TYPE;

+ 0 - 12
src/main/resources/dev/jdbc-uas.properties

@@ -1,12 +0,0 @@
-#多账套情况下的主账套
-jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
-jdbc.url=jdbc:oracle:thin:@192.168.253.6:1521:orcl
-jdbc.username=UAS
-jdbc.password=select!#%*(
-jdbc.initialSize=10
-jdbc.maxActive=100
-jdbc.maxIdle=50
-jdbc.minIdle=50
-jdbc.suspectTimeout=60
-jdbc.timeBetweenEvictionRunsMillis=30000
-jdbc.minEvictableIdleTimeMillis=60000

+ 0 - 22
src/main/resources/prod/jdbc-platform.properties

@@ -1,22 +0,0 @@
-#platform
-#dev
-jdbc.platform.dev.url=jdbc:oracle:thin:@192.168.253.6:1521:orcl
-jdbc.platform.dev.username=uuplatformdemo
-jdbc.platform.dev.password=selectuuplatform
-#test
-jdbc.platform.test.url=jdbc:oracle:thin:@192.168.253.6:1521:orcl
-jdbc.platform.test.username=uuplatformdemo
-jdbc.platform.test.password=selectuuplatform
-#prod
-jdbc.platform.prod.url=jdbc:oracle:thin:@10.10.100.200:1521:orcl
-jdbc.platform.prod.username=platform$b2b
-jdbc.platform.prod.password=select*fromuu
-#other configuration
-jdbc.platform.driverClassName=oracle.jdbc.driver.OracleDriver
-jdbc.platform.initialSize=1
-jdbc.platform.maxActive=100
-jdbc.platform.maxIdle=50
-jdbc.platform.minIdle=50
-jdbc.platform.suspectTimeout=60
-jdbc.platform.timeBetweenEvictionRunsMillis=30000
-jdbc.platform.minEvictableIdleTimeMillis=60000

+ 0 - 12
src/main/resources/prod/jdbc-uas.properties

@@ -1,12 +0,0 @@
-#多账套情况下的主账套
-jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
-jdbc.url=jdbc:oracle:thin:@192.168.253.6:1521:orcl
-jdbc.username=UAS
-jdbc.password=select!#%*(
-jdbc.initialSize=10
-jdbc.maxActive=100
-jdbc.maxIdle=50
-jdbc.minIdle=50
-jdbc.suspectTimeout=60
-jdbc.timeBetweenEvictionRunsMillis=30000
-jdbc.minEvictableIdleTimeMillis=60000

+ 0 - 8
src/main/resources/prod/js-rest-api.properties

@@ -1,8 +0,0 @@
-schema=http
-host=192.168.253.60
-port=8080
-contextRoot=jasperserver
-rest=rest_v2
-resources=resources
-authorization=amFzcGVyYWRtaW46amFzcGVyYWRtaW4=
-images=Picture

+ 0 - 15
src/main/resources/prod/logging.properties

@@ -1,15 +0,0 @@
-#Tomcat Logger
-
-handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler   
-  
-############################################################   
-# Handler specific properties.   
-# Describes specific configuration info for Handlers.   
-############################################################   
-  
-org.apache.juli.FileHandler.level = FINE   
-org.apache.juli.FileHandler.directory = ${catalina.base}/logs   
-org.apache.juli.FileHandler.prefix = error-debug.   
-  
-java.util.logging.ConsoleHandler.level = FINE   
-java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

+ 96 - 41
src/main/resources/spring/applicationContext.xml

@@ -12,7 +12,9 @@
 	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
 	http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-4.1.xsd">
 
+	<context:property-placeholder location="classpath*:spring/*.properties" />
 	<context:property-placeholder location="classpath*:${profile}/*.properties" />
+
 	<!-- 注册spring上下文对象 -->
 	<bean class="com.uas.report.support.ApplicationContextRegister" />
 
@@ -21,7 +23,7 @@
 		location="classpath:${profile}/sys.properties" />
 	<!-- jasperserver rest_v2 api 相关参数注入 -->
 	<util:properties id="js_rest_api"
-		location="classpath:${profile}/js-rest-api.properties" />
+		location="classpath:spring/js-rest-api.properties" />
 
 	<!-- 扫描注解 -->
 	<context:annotation-config />
@@ -31,28 +33,42 @@
 	<!-- UAS标准帐套 -->
 	<bean id="defaultSob" class="com.alibaba.druid.pool.DruidDataSource"
 		init-method="init" destroy-method="close">
+		<!-- 基本属性 url、user、password -->
 		<property name="driverClassName" value="${jdbc.driverClassName}" />
 		<property name="url" value="${jdbc.url}" />
 		<property name="username" value="${jdbc.username}" />
 		<property name="password" value="${jdbc.password}" />
+
+		<!-- 配置初始化大小、最小、最大 -->
 		<property name="initialSize" value="${jdbc.initialSize}" />
-		<property name="maxActive" value="${jdbc.maxActive}" />
-		<property name="maxIdle" value="${jdbc.maxIdle}" />
 		<property name="minIdle" value="${jdbc.minIdle}" />
+		<property name="maxActive" value="${jdbc.maxActive}" />
+
 		<!-- 配置获取连接等待超时的时间 -->
-		<property name="maxWait" value="60000" />
-		<property name="testOnBorrow" value="false" />
-		<property name="testOnReturn" value="false" />
-		<property name="testWhileIdle" value="true" />
-		<property name="validationQuery" value="SELECT 1 FROM SYS.DUAL" />
-		<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接 -->
+		<property name="maxWait" value="${jdbc.maxWait}" />
+
+		<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
 		<property name="timeBetweenEvictionRunsMillis" value="${jdbc.timeBetweenEvictionRunsMillis}" />
-		<!-- 配置一个连接在池中最小生存的时间 -->
+
+		<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
 		<property name="minEvictableIdleTimeMillis" value="${jdbc.minEvictableIdleTimeMillis}" />
+
+		<property name="validationQuery" value="SELECT 1 FROM DUAL" />
+		<property name="testWhileIdle" value="true" />
+		<property name="testOnBorrow" value="false" />
+		<property name="testOnReturn" value="false" />
+
+		<!-- 关闭长时间不使用的连接,打开removeAbandoned功能 -->
+		<property name="removeAbandoned" value="true" />
+		<property name="removeAbandonedTimeout" value="${jdbc.removeAbandonedTimeout}" />
+		<!-- 关闭abanded连接时输出错误日志 -->
+		<property name="logAbandoned" value="true" />
+
 		<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
 		<property name="poolPreparedStatements" value="true" />
 		<property name="maxPoolPreparedStatementPerConnectionSize"
-			value="100" />
+			value="${jdbc.maxPoolPreparedStatementPerConnectionSize}" />
+
 		<!-- 配置监控统计拦截的filters -->
 		<property name="filters" value="stat" />
 	</bean>
@@ -64,25 +80,38 @@
 		<property name="url" value="${jdbc.platform.dev.url}" />
 		<property name="username" value="${jdbc.platform.dev.username}" />
 		<property name="password" value="${jdbc.platform.dev.password}" />
+
+		<!-- 配置初始化大小、最小、最大 -->
 		<property name="initialSize" value="${jdbc.platform.initialSize}" />
-		<property name="maxActive" value="${jdbc.platform.maxActive}" />
-		<property name="maxIdle" value="${jdbc.platform.maxIdle}" />
 		<property name="minIdle" value="${jdbc.platform.minIdle}" />
+		<property name="maxActive" value="${jdbc.platform.maxActive}" />
+
 		<!-- 配置获取连接等待超时的时间 -->
-		<property name="maxWait" value="60000" />
-		<property name="testOnBorrow" value="false" />
-		<property name="testOnReturn" value="false" />
-		<property name="testWhileIdle" value="true" />
-		<property name="validationQuery" value="SELECT 1 FROM SYS.DUAL" />
-		<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接 -->
+		<property name="maxWait" value="${jdbc.platform.maxWait}" />
+
+		<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
 		<property name="timeBetweenEvictionRunsMillis"
 			value="${jdbc.platform.timeBetweenEvictionRunsMillis}" />
-		<!-- 配置一个连接在池中最小生存的时间 -->
+
+		<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
 		<property name="minEvictableIdleTimeMillis" value="${jdbc.platform.minEvictableIdleTimeMillis}" />
+
+		<property name="validationQuery" value="SELECT 1 FROM DUAL" />
+		<property name="testWhileIdle" value="true" />
+		<property name="testOnBorrow" value="false" />
+		<property name="testOnReturn" value="false" />
+
+		<!-- 关闭长时间不使用的连接,打开removeAbandoned功能 -->
+		<property name="removeAbandoned" value="true" />
+		<property name="removeAbandonedTimeout" value="${jdbc.platform.removeAbandonedTimeout}" />
+		<!-- 关闭abanded连接时输出错误日志 -->
+		<property name="logAbandoned" value="true" />
+
 		<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
 		<property name="poolPreparedStatements" value="true" />
 		<property name="maxPoolPreparedStatementPerConnectionSize"
-			value="100" />
+			value="${jdbc.platform.maxPoolPreparedStatementPerConnectionSize}" />
+
 		<!-- 配置监控统计拦截的filters -->
 		<property name="filters" value="stat" />
 	</bean>
@@ -94,25 +123,38 @@
 		<property name="url" value="${jdbc.platform.test.url}" />
 		<property name="username" value="${jdbc.platform.test.username}" />
 		<property name="password" value="${jdbc.platform.test.password}" />
+
+		<!-- 配置初始化大小、最小、最大 -->
 		<property name="initialSize" value="${jdbc.platform.initialSize}" />
-		<property name="maxActive" value="${jdbc.platform.maxActive}" />
-		<property name="maxIdle" value="${jdbc.platform.maxIdle}" />
 		<property name="minIdle" value="${jdbc.platform.minIdle}" />
+		<property name="maxActive" value="${jdbc.platform.maxActive}" />
+
 		<!-- 配置获取连接等待超时的时间 -->
-		<property name="maxWait" value="60000" />
-		<property name="testOnBorrow" value="false" />
-		<property name="testOnReturn" value="false" />
-		<property name="testWhileIdle" value="true" />
-		<property name="validationQuery" value="SELECT 1 FROM SYS.DUAL" />
-		<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接 -->
+		<property name="maxWait" value="${jdbc.platform.maxWait}" />
+
+		<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
 		<property name="timeBetweenEvictionRunsMillis"
 			value="${jdbc.platform.timeBetweenEvictionRunsMillis}" />
-		<!-- 配置一个连接在池中最小生存的时间 -->
+
+		<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
 		<property name="minEvictableIdleTimeMillis" value="${jdbc.platform.minEvictableIdleTimeMillis}" />
+
+		<property name="validationQuery" value="SELECT 1 FROM DUAL" />
+		<property name="testWhileIdle" value="true" />
+		<property name="testOnBorrow" value="false" />
+		<property name="testOnReturn" value="false" />
+
+		<!-- 关闭长时间不使用的连接,打开removeAbandoned功能 -->
+		<property name="removeAbandoned" value="true" />
+		<property name="removeAbandonedTimeout" value="${jdbc.platform.removeAbandonedTimeout}" />
+		<!-- 关闭abanded连接时输出错误日志 -->
+		<property name="logAbandoned" value="true" />
+
 		<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
 		<property name="poolPreparedStatements" value="true" />
 		<property name="maxPoolPreparedStatementPerConnectionSize"
-			value="100" />
+			value="${jdbc.platform.maxPoolPreparedStatementPerConnectionSize}" />
+
 		<!-- 配置监控统计拦截的filters -->
 		<property name="filters" value="stat" />
 	</bean>
@@ -124,25 +166,38 @@
 		<property name="url" value="${jdbc.platform.prod.url}" />
 		<property name="username" value="${jdbc.platform.prod.username}" />
 		<property name="password" value="${jdbc.platform.prod.password}" />
+
+		<!-- 配置初始化大小、最小、最大 -->
 		<property name="initialSize" value="${jdbc.platform.initialSize}" />
-		<property name="maxActive" value="${jdbc.platform.maxActive}" />
-		<property name="maxIdle" value="${jdbc.platform.maxIdle}" />
 		<property name="minIdle" value="${jdbc.platform.minIdle}" />
+		<property name="maxActive" value="${jdbc.platform.maxActive}" />
+
 		<!-- 配置获取连接等待超时的时间 -->
-		<property name="maxWait" value="60000" />
-		<property name="testOnBorrow" value="false" />
-		<property name="testOnReturn" value="false" />
-		<property name="testWhileIdle" value="true" />
-		<property name="validationQuery" value="SELECT 1 FROM SYS.DUAL" />
-		<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接 -->
+		<property name="maxWait" value="${jdbc.platform.maxWait}" />
+
+		<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
 		<property name="timeBetweenEvictionRunsMillis"
 			value="${jdbc.platform.timeBetweenEvictionRunsMillis}" />
-		<!-- 配置一个连接在池中最小生存的时间 -->
+
+		<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
 		<property name="minEvictableIdleTimeMillis" value="${jdbc.platform.minEvictableIdleTimeMillis}" />
+
+		<property name="validationQuery" value="SELECT 1 FROM DUAL" />
+		<property name="testWhileIdle" value="true" />
+		<property name="testOnBorrow" value="false" />
+		<property name="testOnReturn" value="false" />
+
+		<!-- 关闭长时间不使用的连接,打开removeAbandoned功能 -->
+		<property name="removeAbandoned" value="true" />
+		<property name="removeAbandonedTimeout" value="${jdbc.platform.removeAbandonedTimeout}" />
+		<!-- 关闭abanded连接时输出错误日志 -->
+		<property name="logAbandoned" value="true" />
+
 		<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
 		<property name="poolPreparedStatements" value="true" />
 		<property name="maxPoolPreparedStatementPerConnectionSize"
-			value="100" />
+			value="${jdbc.platform.maxPoolPreparedStatementPerConnectionSize}" />
+
 		<!-- 配置监控统计拦截的filters -->
 		<property name="filters" value="stat" />
 	</bean>

+ 8 - 6
src/main/resources/dev/jdbc-platform.properties → src/main/resources/spring/jdbc-platform.properties

@@ -14,9 +14,11 @@ jdbc.platform.prod.password=select*fromuu
 #other configuration
 jdbc.platform.driverClassName=oracle.jdbc.driver.OracleDriver
 jdbc.platform.initialSize=1
-jdbc.platform.maxActive=100
-jdbc.platform.maxIdle=50
-jdbc.platform.minIdle=50
-jdbc.platform.suspectTimeout=60
-jdbc.platform.timeBetweenEvictionRunsMillis=30000
-jdbc.platform.minEvictableIdleTimeMillis=60000
+jdbc.platform.minIdle=1
+jdbc.platform.maxActive=20
+jdbc.platform.maxWait=60000
+jdbc.platform.timeBetweenEvictionRunsMillis=60000
+jdbc.platform.minEvictableIdleTimeMillis=300000
+#1800s
+jdbc.platform.removeAbandonedTimeout=1800
+jdbc.platform.maxPoolPreparedStatementPerConnectionSize=20

+ 14 - 0
src/main/resources/spring/jdbc-uas.properties

@@ -0,0 +1,14 @@
+#多账套情况下的主账套
+jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
+jdbc.url=jdbc:oracle:thin:@192.168.253.6:1521:orcl
+jdbc.username=UAS
+jdbc.password=select!#%*(
+jdbc.initialSize=1
+jdbc.minIdle=1
+jdbc.maxActive=20
+jdbc.maxWait=60000
+jdbc.timeBetweenEvictionRunsMillis=60000
+jdbc.minEvictableIdleTimeMillis=300000
+#1800s
+jdbc.removeAbandonedTimeout=1800
+jdbc.maxPoolPreparedStatementPerConnectionSize=20

+ 0 - 0
src/main/resources/dev/js-rest-api.properties → src/main/resources/spring/js-rest-api.properties


+ 0 - 0
src/main/resources/dev/logging.properties → src/main/resources/spring/logging.properties


+ 0 - 22
src/main/resources/test/jdbc-platform.properties

@@ -1,22 +0,0 @@
-#platform
-#dev
-jdbc.platform.dev.url=jdbc:oracle:thin:@192.168.253.6:1521:orcl
-jdbc.platform.dev.username=uuplatformdemo
-jdbc.platform.dev.password=selectuuplatform
-#test
-jdbc.platform.test.url=jdbc:oracle:thin:@192.168.253.6:1521:orcl
-jdbc.platform.test.username=uuplatformdemo
-jdbc.platform.test.password=selectuuplatform
-#prod
-jdbc.platform.prod.url=jdbc:oracle:thin:@10.10.100.200:1521:orcl
-jdbc.platform.prod.username=platform$b2b
-jdbc.platform.prod.password=select*fromuu
-#other configuration
-jdbc.platform.driverClassName=oracle.jdbc.driver.OracleDriver
-jdbc.platform.initialSize=1
-jdbc.platform.maxActive=100
-jdbc.platform.maxIdle=50
-jdbc.platform.minIdle=50
-jdbc.platform.suspectTimeout=60
-jdbc.platform.timeBetweenEvictionRunsMillis=30000
-jdbc.platform.minEvictableIdleTimeMillis=60000

+ 0 - 12
src/main/resources/test/jdbc-uas.properties

@@ -1,12 +0,0 @@
-#多账套情况下的主账套
-jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
-jdbc.url=jdbc:oracle:thin:@192.168.253.6:1521:orcl
-jdbc.username=UAS
-jdbc.password=select!#%*(
-jdbc.initialSize=10
-jdbc.maxActive=100
-jdbc.maxIdle=50
-jdbc.minIdle=50
-jdbc.suspectTimeout=60
-jdbc.timeBetweenEvictionRunsMillis=30000
-jdbc.minEvictableIdleTimeMillis=60000

+ 0 - 8
src/main/resources/test/js-rest-api.properties

@@ -1,8 +0,0 @@
-schema=http
-host=192.168.253.60
-port=8080
-contextRoot=jasperserver
-rest=rest_v2
-resources=resources
-authorization=amFzcGVyYWRtaW46amFzcGVyYWRtaW4=
-images=Picture

+ 0 - 15
src/main/resources/test/logging.properties

@@ -1,15 +0,0 @@
-#Tomcat Logger
-
-handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler   
-  
-############################################################   
-# Handler specific properties.   
-# Describes specific configuration info for Handlers.   
-############################################################   
-  
-org.apache.juli.FileHandler.level = FINE   
-org.apache.juli.FileHandler.directory = ${catalina.base}/logs   
-org.apache.juli.FileHandler.prefix = error-debug.   
-  
-java.util.logging.ConsoleHandler.level = FINE   
-java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

+ 1 - 1
src/main/resources/test/sys.properties

@@ -3,4 +3,4 @@ localImagesDir=/Picture
 localJrxmlDir=/jrxml
 host=192.168.253.60
 standardMaster=STANDARD_MASTER
-standardJrxmlsUrl=http://192.168.253.60:8090/report/file/standardJrxmls?userName=%s&onlyData=1
+standardJrxmlsUrl=http://192.168.253.60:8090/report/file/standardJrxmls?userName=%s&onlyData=1

+ 9 - 8
src/main/webapp/resources/js/preview/app.js

@@ -84,7 +84,6 @@ $("#pageIndex").keypress(function(event) {
 				alert(ALERT_FILE_TOO_LARGE);
 				return;
 			}
-			firstRequest = false;
 			pageIndex = value;
 			loadData(pageIndex);
 		} else {
@@ -110,7 +109,7 @@ $("#downloadPdf").click(
 			console.log(new Date().format()
 					+ " ---- subscribed wholePdfGeneratedSignal");
 			$.subscribe("wholePdfGeneratedSignal", downloadPdf);
-			spinner = showLoading(spinner,spinnerContainer);
+			spinner = showLoading(spinner, spinnerContainer);
 			waitWholePdfGenerated();
 		});
 
@@ -193,7 +192,7 @@ function printPdf() {
 	console.log(new Date().format()
 			+ " ---- subscribed wholePdfGeneratedSignal");
 	$.subscribe("wholePdfGeneratedSignal", print);
-	spinner = showLoading(spinner,spinnerContainer);
+	spinner = showLoading(spinner, spinnerContainer);
 	waitWholePdfGenerated();
 }
 
@@ -205,7 +204,9 @@ function print() {
 			+ " ---- received and unsubscribe wholePdfGeneratedSignal");
 	$.unsubscribe("wholePdfGeneratedSignal", print);
 	console.log(new Date().format() + " ---- start print...");
-	setTimeout("hiddenFrame.contentWindow.print();spinner = hideLoading(spinner)", 1000);
+	setTimeout(
+			"hiddenFrame.contentWindow.print();spinner = hideLoading(spinner)",
+			1000);
 }
 
 /**
@@ -237,7 +238,7 @@ function loadPagedPdf(pagedPdfPath, ifPreloadWholePdf) {
 												+ " ---- subscribed wholePdfGeneratedSignal");
 								$.subscribe("wholePdfGeneratedSignal",
 										loadWholePdf);
-								spinner = showLoading(spinner,spinnerContainer);
+								spinner = showLoading(spinner, spinnerContainer);
 								waitWholePdfGenerated();
 							}
 						}
@@ -255,7 +256,7 @@ function loadPagedPdf(pagedPdfPath, ifPreloadWholePdf) {
  */
 function loadData(page) {
 	ctx.clearRect(0, 0, canvas.width, canvas.height);
-	spinner = showLoading(spinner,spinnerContainer);
+	spinner = showLoading(spinner, spinnerContainer);
 	pageIndex = page || 1;
 	var loadPdfDataUrl = "print/loadPdfData" + window.location.search;
 	loadPdfDataUrl = loadPdfDataUrl + "&pageIndex=" + pageIndex;
@@ -275,6 +276,7 @@ function loadData(page) {
 				document.title = getParameter("reportName");
 				// 加载第一页文档,并且预加载整个文档
 				loadPagedPdf(pagedPdfPath, true);
+				firstRequest = false;
 				// $.when(getDocument()).done(loadWholePdf);
 				// console.log(renderTask._internalRenderTask.running);
 			} else {
@@ -362,7 +364,7 @@ function getGeneratedPdfOrXlsInformation(fileType) {
 function renderPage() {
 	spinner = hideLoading(spinner);
 	if (firstRequest && printType == "PRINT" && pageSize <= PRINT_MAX_PAGE_SIZE) {
-		spinner = showLoading(spinner,spinnerContainer);
+		spinner = showLoading(spinner, spinnerContainer);
 	}
 	if (!pdfDoc) {
 		return;
@@ -449,7 +451,6 @@ function nextPage() {
 		alert(ALERT_FILE_TOO_LARGE);
 		return;
 	}
-	firstRequest = false;
 	pageIndex++;
 	loadData(pageIndex);
 }