Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

2.4 configPlugin (Plugins me)


May 14, 2021 JFinal manual



This method is used to configure JFinal's Plugin, and the following code is configured with the C3p0 database connection pool plug-in and the ActiveRecord database access plug-in. With the following configuration, it is easy to operate the database in your app using ActiveRecord.


public void configPlugin(Pluginsme)

{ loadPropertyFile("your_app_config.txt");

C3p0Plugin c3p0Plugin = new C3p0Plugin(getProperty("jdbcUrl"), getProperty("user"), getProperty("password"));

me.add(c3p0Plugin);

ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0Plugin); me.add(arp);

arp.addMapping("user",User. class );


The JFinal plug-in architecture is one of its main extensions, which makes it easy to create plug-ins and apply them to projects.