makeIoc(ib.type(), ib.args());
}
public static void makeIoc(Class<? extends IocProvider> clazz, String[] args) {
final ServletContext context = Mvcs.getServletContext();
NutConfig config = new AbstractNutConfig(context) {
public ServletContext getServletContext() {
return context;
}
public List<String> getInitParameterNames() {
return new ArrayList<String>(0);
}
public String getInitParameter(String name) {
return null;
}
public String getAppName() {
return "struts-nutz";
}
};
ioc = Mirror.me(clazz).born().create(config, args);
// 如果是 Ioc2 的实现,增加新的 ValueMaker
if (ioc instanceof Ioc2) {
((Ioc2) ioc).addValueProxyMaker(new ServletValueProxyMaker(config.getServletContext()));
}
}