Recently colleagues in the jfinal dynamic Add data source configuration, thanks to the emergence of JFinal2.0, it is very convenient to solve the problem.
When I look at his code, I inadvertently find that the plug-in also needs to call the start () method, so I think about how to start after configuring the plug-in in the general configuration class. So I looked for an afternoon and finally found it. Thank the Lone Star can be the great god to share the jfinal source 1--jfinal initialization (address: http://my.oschina.net/u/1385515/blog/388831). Some of them are drawn from here.
In the source code of ActiveRecord there is a start () method, select the method name, right-click, Open call Hierarchy, you can see the result of this method is called
You can see that the Config class is called first, called by the Jfinal class, and finally started by Jfinalfilter. The Jfinalfilter is initiated by the Web container because it integrates the Init method (Java Web Foundation) that starts when the Javax.servlet.filter,web container starts ... )。 Finally, there are two ways to start the jfinal container, one is to manually turn on Tomcat and the other is the main method of the general configuration file. Others do not say more, we can explore their own.
JFinal2.0 start other plugins after opening the server