WebApplicationContext ctx=RequestContextUtils.getWebApplicationContext(request);
StudentDAO sd=(StudentDAO)ctx.getBean("studentdao");
Student ss=sd.findById(6);
StudentDAO sd=(StudentDAO)ctx.getBean("studentdao");
Student ss=sd.findById(6);
本文介绍如何在Spring框架中通过WebApplicationContext从请求中获取StudentDAO实例,并使用该实例查询ID为6的学生信息。
334

被折叠的 条评论
为什么被折叠?



