Examples of HandlerExecutionChain


Examples of org.springframework.web.servlet.HandlerExecutionChain

  private void doTestRequestsWithSubPaths(HandlerMapping hm) throws Exception {
    Object bean = wac.getBean("godCtrl");

    MockHttpServletRequest req = new MockHttpServletRequest("GET", "/mypath/welcome.html");
    HandlerExecutionChain hec = hm.getHandler(req);
    assertTrue("Handler is correct bean", hec != null && hec.getHandler() == bean);

    req = new MockHttpServletRequest("GET", "/myapp/mypath/welcome.html");
    req.setContextPath("/myapp");
    hec = hm.getHandler(req);
    assertTrue("Handler is correct bean", hec != null && hec.getHandler() == bean);
   
    req = new MockHttpServletRequest("GET", "/myapp/mypath/welcome.html");
    req.setContextPath("/myapp");
    req.setServletPath("/mypath/welcome.html");
    hec = hm.getHandler(req);
    assertTrue("Handler is correct bean", hec != null && hec.getHandler() == bean);

    req = new MockHttpServletRequest("GET", "/myapp/myservlet/mypath/welcome.html");
    req.setContextPath("/myapp");
    req.setServletPath("/myservlet");
    hec = hm.getHandler(req);
    assertTrue("Handler is correct bean", hec != null && hec.getHandler() == bean);

    req = new MockHttpServletRequest("GET", "/myapp/myapp/mypath/welcome.html");
    req.setContextPath("/myapp");
    req.setServletPath("/myapp");
    hec = hm.getHandler(req);
    assertTrue("Handler is correct bean", hec != null && hec.getHandler() == bean);

    req = new MockHttpServletRequest("GET", "/mypath/show.html");
    hec = hm.getHandler(req);
    assertTrue("Handler is correct bean", hec != null && hec.getHandler() == bean);

    req = new MockHttpServletRequest("GET", "/mypath/bookseats.html");
    hec = hm.getHandler(req);
    assertTrue("Handler is correct bean", hec != null && hec.getHandler() == bean);
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

    hm.setAlwaysUseFullPath(true);
    hm.setApplicationContext(wac);
    Object bean = wac.getBean("godCtrl");

    MockHttpServletRequest req = new MockHttpServletRequest("GET", "/mypath/welcome.html");
    HandlerExecutionChain hec = hm.getHandler(req);
    assertTrue("Handler is correct bean", hec != null && hec.getHandler() == bean);

    req = new MockHttpServletRequest("GET", "/myapp/mypath/welcome.html");
    req.setContextPath("/myapp");
    hec = hm.getHandler(req);
    assertTrue("Handler is correct bean", hec != null && hec.getHandler() == bean);

    req = new MockHttpServletRequest("GET", "/mypath/welcome.html");
    req.setContextPath("");
    req.setServletPath("/mypath");
    hec = hm.getHandler(req);
    assertTrue("Handler is correct bean", hec != null && hec.getHandler() == bean);

    req = new MockHttpServletRequest("GET", "/Myapp/mypath/welcome.html");
    req.setContextPath("/myapp");
    req.setServletPath("/mypath");
    hec = hm.getHandler(req);
    assertTrue("Handler is correct bean", hec != null && hec.getHandler() == bean);

    req = new MockHttpServletRequest("GET", "/");
    hec = hm.getHandler(req);
    assertTrue("Handler is correct bean", hec != null && hec.getHandler() == bean);
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

    this.hm = (HandlerMapping) this.wac.getBean("mapping");
  }

  public void testIndexUri() throws Exception {
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/index");
    HandlerExecutionChain chain = this.hm.getHandler(request);
    assertEquals(this.wac.getBean("index"), chain.getHandler());
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

    assertEquals(this.wac.getBean("index"), chain.getHandler());
  }

  public void testMapSimpleUri() throws Exception {
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/welcome");
    HandlerExecutionChain chain = this.hm.getHandler(request);
    assertEquals(this.wac.getBean("welcome"), chain.getHandler());
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

  }

  public void testWithContextPath() throws Exception {
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/myapp/welcome");
    request.setContextPath("/myapp");
    HandlerExecutionChain chain = this.hm.getHandler(request);
    assertEquals(this.wac.getBean("welcome"), chain.getHandler());
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

    assertEquals(this.wac.getBean("welcome"), chain.getHandler());
  }

  public void testWithMultiActionControllerMapping() throws Exception {
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/admin");
    HandlerExecutionChain chain = this.hm.getHandler(request);
    assertEquals(this.wac.getBean("admin"), chain.getHandler());
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

    assertEquals(this.wac.getBean("admin"), chain.getHandler());
  }

  public void testWithoutControllerSuffix() throws Exception {
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/buy");
    HandlerExecutionChain chain = this.hm.getHandler(request);
    assertEquals(this.wac.getBean("buy"), chain.getHandler());
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

    this.hm4 = (HandlerMapping) this.wac.getBean("mapping4");
  }

  public void testIndexUri() throws Exception {
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/");
    HandlerExecutionChain chain = this.hm.getHandler(request);
    assertEquals(this.wac.getBean("index"), chain.getHandler());
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

    assertEquals(this.wac.getBean("index"), chain.getHandler());
  }

  public void testMapSimpleUri() throws Exception {
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/welcome");
    HandlerExecutionChain chain = this.hm.getHandler(request);
    assertEquals(this.wac.getBean("welcome"), chain.getHandler());
  }
View Full Code Here

Examples of org.springframework.web.servlet.HandlerExecutionChain

  }

  public void testWithContextPath() throws Exception {
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/myapp/welcome");
    request.setContextPath("/myapp");
    HandlerExecutionChain chain = this.hm.getHandler(request);
    assertEquals(this.wac.getBean("welcome"), chain.getHandler());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.