Velocity templates not substituting methods
问题 In the Velocity User's Guide it seems pretty straight forward to use methods in templates. I tried, but could not make it work. Can someone tell me what I did wrong? Thanks. This is my code @Test public void testVelocity() { Velocity.init(); VelocityContext map = new VelocityContext(); map.put("test", "Success"); map.put("ok", "OK!"); map.put("func", new Object() {public String test() {return "Yay!";}}); map.put("func2", new Object() {public String test(String t) {return t+t;}}); String