用beetl自定义标签,需要注入一个service,但是注入的结果是null,这个该咋搞
@IocBean
public class DictTag extends GeneralVarTagBinding {
String style,dictType;
String type = "checkbox";
@Inject
MacroService macroService;
private void init() {
style = (String)getAttributeValue("style");
dictType = (String)getAttributeValue("dictType");
type = (String)getAttributeValue("type");
}
@Override
public void render() {
init();
List<Macro> list = macroService.listByDictType(dictType);
System.out.println(list.size());
}
}
貌似上面写的是@IocBean不行。。