spring mvc - How to access normal java objects in FTL? -
i using spring 4 freemarker template. have helper class methods want access in ftl template file. don't want pass model. how can it?
look @ this, can pass helper class: http://www.javawebdevelop.com/1389653/
// ftl public static templatehashmodel usestaticpackage(string packagename) { try { beanswrapper wrapper = beanswrapper.getdefaultinstance(); templatehashmodel staticmodels = wrapper.getstaticmodels(); templatehashmodel filestatics = (templatehashmodel) staticmodels.get(packagename); return filestatics; } catch (exception e) { e.printstacktrace(); } } // //data.put("list", list); data.put("helper",usestaticpackage("com.test.helper")); // ftl ${helper.method()}