Package org.apache.nutch.webapp.common

Examples of org.apache.nutch.webapp.common.WebAppModule


  public void testWebAppModule() {
    String webxml = "<web-app><servlet-mapping><servlet-name>a</servlet-name><url-pattern>/a.jsp</url-pattern></servlet-mapping>";
    webxml += "<servlet-mapping><servlet-name>b</servlet-name><url-pattern>/b.jsp</url-pattern></servlet-mapping>";
    webxml += "<servlet-mapping><servlet-name>c</servlet-name><url-pattern>/c.jsp</url-pattern></servlet-mapping></web-app>";

    WebAppModule module;
    module = new WebAppModule(new ByteArrayInputStream(webxml.getBytes()));
    assertEquals(3, module.getPaths().size());

    assertEquals("/a.jsp", module.getPaths().get(0));
    assertEquals("/b.jsp", module.getPaths().get(1));
    assertEquals("/c.jsp", module.getPaths().get(2));

    assertEquals("a", module.getServletName("/a.jsp"));
    assertEquals("b", module.getServletName("/b.jsp"));
    assertEquals("c", module.getServletName("/c.jsp"));
  }
View Full Code Here


      Extension[] extensions = point.getExtensions();

      for (int i = 0; i < extensions.length; i++) {
        Extension extension = extensions[i];

        WebAppModule module = new WebAppModule(extension.getDescriptor()
            .getClassLoader(), conf);
        Iterator iterator = module.getPaths().iterator();

        while (iterator.hasNext()) {
          String path = (String) iterator.next();
          allMappings.put(path, module);
        }
View Full Code Here

    //get jsp include path_info from request object
    String relPath=(String)request.getAttribute("javax.servlet.include.path_info");

    if (allMappings.containsKey(relPath)) {
      WebAppModule module=(WebAppModule)allMappings.get(relPath);
      module.dispatch(relPath, request,response);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.nutch.webapp.common.WebAppModule

Copyright © 2018 www.massapicom. 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.