速度(测试实例)

Ami*_*ira 30 velocity

如何在速度模板中测试给定对象的类.我找不到instanceof指令

ser*_*erg 27

没有instanceof,但你可以将类名作为字符串,然后从那里开始:

${myObj.class.name} would return "com.test.MyObj"
${myObj.class.simpleName} would return "MyObj"
Run Code Online (Sandbox Code Playgroud)