日期:2014-05-19 浏览次数:20674 次
@Action("/tagTest")
public String tagTest() throws Exception{
System.out.println("ActionCode:"+hashCode());
System.out.println("serviceCode1:"+studentManager.hashCode());
studentManager.queryById(3);
System.out.println("----");
return "tagTest";
}
@Action("/testList")
public String testList() throws Exception{
System.out.println("ActionCode:"+hashCode());
System.out.println("serviceCode1:"+studentManager.hashCode());
//action不一样(原型模式),但是dao、service的hashCode却一样(单例模式)
//action里边service的hashCode、service自己的this.hashCode()却不一样?
studentManager.queryById(3);
System.out.println("----");
return "tagTest";
}
public Student queryById(int id) throws Exception{
System.out.println("daoCode:"+studentDao.hashCode());
System.out.println("serviceCode2:"+hashCode());
return studentDao.queryByID(id);
}