Spring (项目名叫telssh)"/telssh/WebRoot/WEB-INF/applicationContext.xml"request.getContextPath()+"/WebRoot/WEB-INF/applicationContext.xml"这不都是绝对路径吗??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在web.xml文件加入 <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> <servlet> <servlet-name>SpringContextServlet</servlet-name> <servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class> <load-on-startup>2</load-on-startup> </servlet> 这样得到:ApplicationContext context=WebApplicationContextUtils.getWebApplicationContext(this.getServlet().getServletContext()); IEmpServices ies = (IEmpServices)context.getBean("empServices");别外配置<pulg in>也可以 答复simphoneyo() 你这样强行加载倒也是可以...我之所以这样写是因为我不想用Spring来代理Struts不过还是得谢谢你的答复,呵呵 谁有map的详细用法!分享下!谢谢各位大哥大姐了!~~~ 请推荐一本学习xml的书(java)! 如何学习J2EE ,请各位大侠赐教 hibernate 异常问题 WordNet2.0关于英文单词概率的问题 初次使用struts遇到的问题 哪位是英语高手??帮我看看Java2 SDK API中的帮助,本人英文很菜。。。大家帮忙 select方法如何使用? 在JAVA应用程序中可以连接访问数据库在JAVA小程序中则不能原因出在何处?(急!!) 请各位推荐几本EJB,servlet,jsp的好书 spring事务问题 紧急请教一个HttpSession处理的问题
<context-param> <param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet> 这样得到:
ApplicationContext context=WebApplicationContextUtils.getWebApplicationContext(this.getServlet().getServletContext());
IEmpServices ies = (IEmpServices)context.getBean("empServices");
别外配置<pulg in>也可以
你这样强行加载倒也是可以...
我之所以这样写是因为我不想用Spring来代理Struts
不过还是得谢谢你的答复,呵呵