Skip to content

Commit

Permalink
springboot迁移:添加Servlet容器war包运行模式配置
Browse files Browse the repository at this point in the history
  • Loading branch information
datageartech committed Nov 10, 2020
1 parent 657d3d1 commit db86d9c
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ public synchronized Driver getDriver(String driverClassName) throws PathDriverFa
throw new PathDriverFactoryException(
"No Driver named [" + driverClassName + "] found in [" + this.path + "]");

if (LOGGER.isInfoEnabled())
LOGGER.info("Get JDBC driver [" + driverClassName + "] in path [" + this.path + "]");
if (LOGGER.isDebugEnabled())
LOGGER.debug("Get JDBC driver [" + driverClassName + "] in path [" + this.path + "]");

return driver;
}
Expand Down
11 changes: 10 additions & 1 deletion datagear-web/dist/bin/config/application.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#--UTF-8 file--

#是否禁用匿名用户功能,禁用后,匿名用户将不能使用系统功能
#可选值:true 表示禁用;false 表示不禁用
#disableAnonymous=false

#是否禁用注册功能
#可选值:true 表示禁用;false 表示不禁用
#disableRegister=false

#日志级别
#ERROR, WARN, INFO, DEBUG, TRACE
logging.level.root=INFO

#日志路径
#日志存储路径
logging.file.name=logs/datagear.log
3 changes: 1 addition & 2 deletions datagear-web/dist/bin/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ DataGear是一款数据可视化分析平台,使用Java语言开发,采用
Windows:
startup.bat

然后打开浏览器,输入服务地址:
打开浏览器,输入服务地址:
http://[IP地址]:50401
开始使用。


官网:http://www.datagear.tech

文档:http://www.datagear.tech/documentation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration;
import org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration;
import org.springframework.core.env.Environment;

Expand All @@ -22,7 +23,11 @@
* @author [email protected]
*
*/
@SpringBootApplication(scanBasePackageClasses = WebMvcConfigurerConfig.class, exclude = ErrorMvcAutoConfiguration.class)
@SpringBootApplication(scanBasePackageClasses = WebMvcConfigurerConfig.class, exclude = {
// 错误页面完全自定义
ErrorMvcAutoConfiguration.class,
// Freemarker完全自定义
FreeMarkerAutoConfiguration.class })
public class DataGearApplication
{
public static void main(String[] args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
*/
public class DataGearServletInitializer extends SpringBootServletInitializer
{
/** 系统作为war包部署至Servlet容器时加载配置项标识,参考:application-war.properties */
public static final String PROFILE_WAR = "war";

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
{
application.profiles(PROFILE_WAR);
return application.sources(DataGearApplication.class).banner(new DataGearBanner());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
*/
@Configuration
@ImportResource("org/datagear/web/transactionConfig.xml")
@ImportResource("classpath:org/datagear/web/transactionConfig.xml")
public class TransactionConfig
{
/** transactionConfig.xml中使用此Bean名 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import org.springframework.security.crypto.password.StandardPasswordEncoder;

@SuppressWarnings("deprecation")
public class StandardPasswordEncoderPrinter
{
private static StandardPasswordEncoder standardPasswordEncoder = new StandardPasswordEncoder();
Expand Down
8 changes: 8 additions & 0 deletions datagear-web/src/main/resources/application-war.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#--UTF-8 file--

#-----------------------------------------
#当系统作为war包部署至Servlet容器时将加载这里配置项
#-----------------------------------------

#日志存储路径
logging.file.name=${user.home}/.datagear_logs/datagear.log
9 changes: 9 additions & 0 deletions datagear-web/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#--UTF-8 file--

#是否禁用匿名用户功能,禁用后,匿名用户将不能使用系统功能
#可选值:true 表示禁用;false 表示不禁用
#disableAnonymous=false

#是否禁用注册功能
#可选值:true 表示禁用;false 表示不禁用
#disableRegister=false

#日志
#ERROR, WARN, INFO, DEBUG, TRACE
#logging.level.root=DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="get*" read-only="true" />
<tx:method name="load*" read-only="true" />
<tx:method name="find*" read-only="true" />
<tx:method name="query*" read-only="true" />
<tx:method name="pagingQuery*" read-only="true" />
<tx:method name="exists*" read-only="true" />
<tx:method name="isExists*" read-only="true" />
<tx:method name="is*" read-only="true" />
<tx:method name="*" />
</tx:attributes>
</tx:advice>
Expand Down

0 comments on commit db86d9c

Please sign in to comment.