(项目名叫telssh)"/telssh/WebRoot/WEB-INF/applicationContext.xml"
request.getContextPath()+"/WebRoot/WEB-INF/applicationContext.xml"
这不都是绝对路径吗???

解决方案 »

  1.   

    在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>也可以
      

  2.   

    答复simphoneyo() 
    你这样强行加载倒也是可以...
    我之所以这样写是因为我不想用Spring来代理Struts
    不过还是得谢谢你的答复,呵呵