change: ureport默认不关联数据源

This commit is contained in:
Wendal Chen 2017-12-26 21:54:32 +08:00
parent f4fd9376eb
commit aa2103bd41
3 changed files with 11 additions and 4 deletions

View File

@ -3,4 +3,5 @@ jetty.host=127.0.0.1
jdbc.url=jdbc:h2:mem:~
ureport.repository.dir=./ureport.repo
ureport.repository.dir=./ureport.repo
ureport.nutzboot.dsName=nutzboot

View File

@ -51,7 +51,7 @@ public class NutFilterStarter implements WebFilterFace {
if (conf.has("nutz.mvc.ignore")) {
params.put("ignore", conf.get("nutz.mvc.ignore"));
}
params.put("exclusions", conf.get("nutz.mvc.exclusions", "/druid/*,/uflo/*,/webservice/*,/swagger/*"));
params.put("exclusions", conf.get("nutz.mvc.exclusions", "/druid/*,/uflo/*,/ureport/*,/urule/*,/webservice/*,/swagger/*"));
return params;
}

View File

@ -8,8 +8,11 @@ import javax.servlet.ServletContextEvent;
import javax.sql.DataSource;
import org.nutz.boot.tools.SpringWebContextProxy;
import org.nutz.ioc.impl.PropertiesProxy;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Mirror;
import org.nutz.lang.Strings;
import com.bstek.ureport.Utils;
import com.bstek.ureport.definition.datasource.BuildinDatasource;
@ -18,6 +21,9 @@ import com.bstek.ureport.provider.image.ImageProvider;
@IocBean
public class UreportSpringEnvStarter extends SpringWebContextProxy {
@Inject
protected PropertiesProxy conf;
public UreportSpringEnvStarter() {
configLocation = "classpath:ureport-spring-context.xml";
selfName = "ureport";
@ -35,12 +41,12 @@ public class UreportSpringEnvStarter extends SpringWebContextProxy {
super.contextInitialized(sce);
// 把BuildinDatasource统统注册一下
List<BuildinDatasource> buildinDatasources = appContext.getBeans(BuildinDatasource.class);
if (appContext.getIoc().has("dataSource")) {
if (!Strings.isBlank(conf.get("ureport.nutzboot.dsName"))) {
// 添加一个内置的BuildinDatasource
DataSource ds = appContext.getIoc().get(DataSource.class);
buildinDatasources.add(new BuildinDatasource() {
public String name() {
return "nutzboot.buildin";
return conf.get("ureport.nutzboot.dsName");
}
public Connection getConnection() {