自己读这个文件吧。InputStream is = getClass.getResourceAsStream(request.getSession().getServletContext().getInitParameter("contextConfigLocation")) ;Digester d= new Digester();d.addObjectCreate("/xxx/yyyy/",YYyyyy.class);从来没有用过 Hibernate ,不知道 这个 applicationContext.xml 啥内容。

解决方案 »

  1.   

    JAXB 对这样的东西更省力,
      

  2.   


    <%@ page import="org.springframework.context.ApplicationContext" %>
    <%@ page import="org.springframework.web.context.support.WebApplicationContextUtils" %>
    ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(session.getServletContext());
    IXXXService service = (IXXXService)ctx.getBean("IXXXService");通过这样的方法可以方便的在jsp中得到applicationContext.xml中定义的Bean。
      

  3.   

    大狗:我最近在学习Spring,能不能和你交个朋友啊!我的[email protected]