标签:
1、在configPlugin中配置以下代码
// DruidPlugin
DruidPlugin dp = new DruidPlugin(url, username, password, "com.mysql.jdbc.Driver");
dp.addFilter(new StatFilter());
WallFilter wall = new WallFilter();
wall.setDbType("mysql");
dp.addFilter(wall);
me.add(dp);
// ActiveRecordPlugin
ActiveRecordPlugin arp = new ActiveRecordPlugin(dp);
arp.addMapping("user", User.class);
me.add(arp);
2、在configHandler中添加以下代码
DruidStatViewHandler dvh = new DruidStatViewHandler("/druid");
me.add(dvh);
标签:
原文地址:http://my.oschina.net/zjhlearn/blog/488915