@At("/user")
@IocBean(name="hello", fields = {"dao"})
public class Hello extends NameEntityService{
/* @Inject("testService")
private TestService testService;*/
/* @Inject
public Dao dao;*/
@At("/login")
@Ok("jsp:/pages/index")
public void login(){
food f=this.dao().fetch(food.class, 1);
food ffff= this.dao().fetch(food.class, 1);
food foo = this.dao().fetchLinks(f, "pets");
System.out.print("数据的条数"+foo.getPets().size());
for(pet p:foo.getPets()){
System.out.println("打印出来的name" + p.getName());
pet pp=this.dao().fetch(pet.class, p.getId());
pet ppp=this.dao().fetchLinks(pp,"foods");
for(food ff:ppp.getFoods()){
System.out.println("打印出来的food"+ff.getName());
}
System.out.println("打印出来的id" + p.getId());
}
}
var ioc = {
dataSource : {
type : "org.nutz.dao.impl.SimpleDataSource",
fields : {
jdbcUrl : 'jdbc:mysql://localhost:3306/nutz?characterEncoding=UTF-8',
username : 'root',
password : '551969'
}
},
dao : {
type : "org.nutz.dao.impl.NutDao",
args : [{refer:"dataSource"}]
}
}
var ioc = {
hello:{
type:"com.askj.action.Hello",
fileds:{
dao : 'dao'
}
}
}
为什么我fileds={"hello"}就报错了 这个fileds到底和什么挂钩