Package org.eclipse.jst.j2ee.webapplication

Examples of org.eclipse.jst.j2ee.webapplication.ServletMapping


    // Add mappings
    Iterator it = urlMappingList.iterator();
    while (it.hasNext()) {
      String pattern = (String) it.next();
      if (!(doesServletMappingExist(webApp, servlet, pattern))){
        ServletMapping mapping = WebapplicationFactory.eINSTANCE
            .createServletMapping();
        mapping.setServlet(servlet);
        mapping.setName(servlet.getServletName());
        mapping.setUrlPattern(pattern);
        webApp.getServletMappings().add(mapping);
      }
    }
  }
View Full Code Here


    if (servletName != null)
    {
        final Iterator it = mappings.iterator();
      while(it.hasNext())
      {
        ServletMapping mapping = (ServletMapping) it.next();
        if (mapping != null &&
            mapping.getServlet() != null &&
            mapping.getServlet().getServletName() != null &&
            mapping.getServlet().getServletName().trim().equals(servletName) &&
            mapping.getUrlPattern() != null &&
            mapping.getUrlPattern().trim().equals(pattern)) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

  public static void removeURLMappings(final WebApp webApp, final Servlet servlet) {
    List mappings = webApp.getServletMappings();
    String servletName = servlet.getServletName();
    if (servletName != null) {
      for (int i=mappings.size()-1;i>=0;--i){
        ServletMapping mapping = (ServletMapping)mappings.get(i);
        if (mapping != null &&
            mapping.getServlet() != null &&
            mapping.getServlet().getServletName() != null &&
            mapping.getServlet().getServletName().trim()
              .equals(servletName)) {
          mappings.remove(mapping);
        }
      }
    }
View Full Code Here

      String servletName = servlet.getServletName();
      servletName = servletName != null ? servletName.trim() : servletName;
      final List<ServletMapping> mappings = new ArrayList<ServletMapping>();
    final List<ServletMapping> allMappings = webApp.getServletMappings();
    for (int i=allMappings.size()-1;i>=0;--i){
      ServletMapping mapping = allMappings.get(i);
      if (mapping != null &&
          mapping.getServlet() != null &&
          mapping.getServlet().getServletName() != null &&
          mapping.getServlet().getServletName().trim().equals(servletName))
        mappings.add(mapping);
    }
    return mappings;
  }
View Full Code Here

    // Add mappings
    Iterator it = urlMappingList.iterator();
    while (it.hasNext()) {
      String pattern = (String) it.next();
      if (!(doesServletMappingExist(webApp, servlet, pattern))){
        ServletMapping mapping = WebapplicationFactory.eINSTANCE
            .createServletMapping();
        mapping.setServlet(servlet);
        mapping.setName(servlet.getServletName());
        mapping.setUrlPattern(pattern);
        webApp.getServletMappings().add(mapping);
      }
    }
  }
View Full Code Here

    if (servletName != null)
    {
        final Iterator it = mappings.iterator();
      while(it.hasNext())
      {
        ServletMapping mapping = (ServletMapping) it.next();
        if (mapping != null &&
            mapping.getServlet() != null &&
            mapping.getServlet().getServletName() != null &&
            mapping.getServlet().getServletName().trim().equals(servletName) &&
            mapping.getUrlPattern() != null &&
            mapping.getUrlPattern().trim().equals(pattern)) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

  public static void removeURLMappings(final WebApp webApp, final Servlet servlet) {
    List mappings = webApp.getServletMappings();
    String servletName = servlet.getServletName();
    if (servletName != null) {
      for (int i=mappings.size()-1;i>=0;--i){
        ServletMapping mapping = (ServletMapping)mappings.get(i);
        if (mapping != null &&
            mapping.getServlet() != null &&
            mapping.getServlet().getServletName() != null &&
            mapping.getServlet().getServletName().trim()
              .equals(servletName)) {
          mappings.remove(mapping);
        }
      }
    }
View Full Code Here

    if (servletName != null) {
      @SuppressWarnings("rawtypes")
      Iterator oldMappings = webApp.getServletMappings().iterator();

      while (oldMappings.hasNext()) {
        ServletMapping mapping = (ServletMapping) oldMappings.next();
        if (mapping.getServlet().getServletName().equals(servletName)) {
          webApp.getServletMappings().remove(mapping);
        }
      }
    }
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  public static void setUpURLMappings(WebApp webApp, String[] urlMappingList, Servlet servlet) {
    // Add mappings
    for (int i=0;i<urlMappingList.length;i++) {
      String pattern = urlMappingList[i];
      ServletMapping mapping = WebapplicationFactory.eINSTANCE.createServletMapping();
      mapping.setServlet(servlet);
      mapping.setName(servlet.getServletName());
      mapping.setUrlPattern(pattern);
      webApp.getServletMappings().add(mapping);
    }
  }
View Full Code Here

    if (servletName != null) {
      @SuppressWarnings("unchecked")
      Iterator oldMappings = webApp.getServletMappings().iterator();
     
      while (oldMappings.hasNext()) {
        ServletMapping mapping = (ServletMapping) oldMappings.next();
        if (mapping.getServlet().getServletName().equals(servletName)) {
          webApp.getServletMappings().remove(mapping);
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jst.j2ee.webapplication.ServletMapping

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.