facebook

** load applicationContext-servlet — how? :S **

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #275122 Reply

    vljc2004
    Member

    Hi!, i’m follow the tutorial hibernate and spring, but i’m want make operate via web with my server tomcat.

    Whereby , im create this class:

    public class ControllerUser implements Controller {
    
        public ModelAndView handleRequest(HttpServletRequest res,
                HttpServletResponse arg1) throws Exception {
            // TODO Auto-generated method stub
            //ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
            //ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext());
            //BeanFactory beanfactory = new XmlBeanFactory(new ClassPathResource("applicationContext-servlet.xml"));
            /*BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource(
            "applicationContext-servlet.xml",getClass()));*/
            //Persistence persistence = (Persistence) beanfactory.getBean("persistance");
            Persistence persistence=new Persistence();
            String dato=res.getParameter("dato");
            Usuarios user=new Usuarios();
            user.setNombre(dato);
            user.setCorreo("hola");
            user.setIdUsuario(1);
            persistence.save(user);
            HashMap datos= new HashMap();
            datos.put("resp", dato);
            System.out.print(datos);
            
            return new ModelAndView("index.jsp","m",datos);
        }
    
    }
    

    Have very line in coment, before im try link my applicationcontext-servle but i’m not can make the link :s.

    The message error is :

    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext-servlet.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext-servlet.xml] cannot be opened because it does not exist
    #275143 Reply

    Loyal Water
    Member

    This seems like a framework specific question/error. Can you cross post this on the spring forums as well.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: ** load applicationContext-servlet — how? :S **

You must be logged in to post in the forum log in