2011-02-23 60 views

回答

1

確定其並不難,只要延伸FreemarkerManager並重寫

@Override 
public SimpleHash buildTemplateModel(ValueStack stack, Object action, ServletContext ervletContext, HttpServletRequest request, HttpServletResponse response, ObjectWrapper wrapper) 

在該方法中,設置的枚舉哈希在模型上的模型。然後設置支柱屬性,

<constant name="struts.freemarker.manager.classname" value="your.freemarker.ConfigClass">