springboot迁移:添加Servlet容器war包运行模式配置

This commit is contained in:
datagear 2020-11-10 19:05:03 +08:00
parent 657d3d163f
commit db86d9c226
10 changed files with 44 additions and 8 deletions

View File

@ -153,8 +153,8 @@ public class PathDriverFactory
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;
}

View File

@ -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

View File

@ -13,11 +13,10 @@ DataGear是一款数据可视化分析平台使用Java语言开发采用
Windows:
startup.bat
然后打开浏览器,输入服务地址:
打开浏览器,输入服务地址:
http://[IP地址]:50401
开始使用。
官网http://www.datagear.tech
文档http://www.datagear.tech/documentation

View File

@ -13,6 +13,7 @@ import org.datagear.web.config.WebMvcConfigurerConfig;
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;
@ -22,7 +23,11 @@ import org.springframework.core.env.Environment;
* @author datagear@163.com
*
*/
@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)

View File

@ -16,9 +16,13 @@ import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
*/
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());
}
}

View File

@ -21,7 +21,7 @@ import org.springframework.transaction.PlatformTransactionManager;
*
*/
@Configuration
@ImportResource("org/datagear/web/transactionConfig.xml")
@ImportResource("classpath:org/datagear/web/transactionConfig.xml")
public class TransactionConfig
{
/** transactionConfig.xml中使用此Bean名 */

View File

@ -6,6 +6,7 @@ package org.datagear.web.security;
import org.springframework.security.crypto.password.StandardPasswordEncoder;
@SuppressWarnings("deprecation")
public class StandardPasswordEncoderPrinter
{
private static StandardPasswordEncoder standardPasswordEncoder = new StandardPasswordEncoder();

View File

@ -0,0 +1,8 @@
#--UTF-8 file--
#-----------------------------------------
#当系统作为war包部署至Servlet容器时将加载这里配置项
#-----------------------------------------
#日志存储路径
logging.file.name=${user.home}/.datagear_logs/datagear.log

View File

@ -1,4 +1,13 @@
#--UTF-8 file--
#是否禁用匿名用户功能,禁用后,匿名用户将不能使用系统功能
#可选值true 表示禁用false 表示不禁用
#disableAnonymous=false
#是否禁用注册功能
#可选值true 表示禁用false 表示不禁用
#disableRegister=false
#日志
#ERROR, WARN, INFO, DEBUG, TRACE
#logging.level.root=DEBUG

View File

@ -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>