Coder Social home page Coder Social logo

获取Map值有错 about jetbrick-template-1x HOT 3 CLOSED

subchen avatar subchen commented on June 25, 2024
获取Map值有错

from jetbrick-template-1x.

Comments (3)

subchen avatar subchen commented on June 25, 2024

因为是强类型编译,所以在类型丢失的时候,需要类型声明,如下:

#define(Map person)
${person["name"]} or ${person.name}

from jetbrick-template-1x.

buzzxu avatar buzzxu commented on June 25, 2024

噢,明白了,感谢回复!
这个能否再改进一下呢,因为模版在velocity和freemarker下都能直接运行的。

from jetbrick-template-1x.

subchen avatar subchen commented on June 25, 2024

这个就是 jetbrick-template 和 velocity 的一个主要区别。 强类型编译是提高性能的主要原因。
完整的性能测试如下: http://my.oschina.net/sub/blog/177288

其实在实际使用的时候,并不需要很多的 #define 语句,大部分变量都是可以通过类型推导来获取变量类型的。

from jetbrick-template-1x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.