Weed3-7. Methods that are embedded in a script or template
This article mainly explains the "weed3-7. Embedded into the script or template method", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "weed3-7. Embedded into the script or template method" bar!
Weed3 a mini ORM framework (only 0.1Mb)
Source code: https://github.com/noear/weed3 source code: https://gitee.com/noear/weed3
Embed into the script engine
Embed into javascript engine (nashorn)
ScriptEngineManager scriptEngineManager = new ScriptEngineManager (); ScriptEngine _ eng = scriptEngineManager.getEngineByName ("nashorn"); Invocable _ eng_call = (Invocable) _ eng;_eng.put ("db", db); var map = db.table ("test"). Where ('id=?',1). GetMap ()
Embed into the groovy engine
ScriptEngineManager scriptEngineManager = new ScriptEngineManager (); ScriptEngine _ eng = scriptEngineManager.getEngineByName ("groovy"); Invocable _ eng_call = (Invocable) _ eng;_eng.put ("db", db); def map = db.table ("test"). Where ('id=?',1). GetMap (); embedded in the template engine
Embed into the Freemarker engine
...
Based on weed3's weakly typed feature, it can be embedded in many languages, or cross-platform implementation can be completed.
Thank you for reading, the above is the content of "weed3-7. Methods embedded in scripts or templates". After the study of this article, I believe that you are interested in weed3-7. The method of embedding into scripts or templates has a deeper understanding, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!