Package org.eclipse.jst.javaee.web

Examples of org.eclipse.jst.javaee.web.ServletMapping


     */
    public static void updateServletMappings(final WebApp webApp,
            final Servlet servlet, final String displayName)
    {
        // update mappings for new name
        ServletMapping mapping = findServletMapping(webApp, servlet);
        if (mapping != null)
        {
            mapping.setServletName(displayName);
        }
    }
View Full Code Here


     * @param servlet
     * @return List of mappings
     */
    public static ServletMapping findServletMapping(final WebApp webApp, final Servlet servlet) {
    for (Iterator it=webApp.getServletMappings().iterator();it.hasNext();){
      ServletMapping mapping = (ServletMapping)it.next();
      if (mapping.getServletName() != null &&
          servlet.getServletName() != null &&
          mapping.getServletName().trim().equals(servlet.getServletName().trim()))
        return mapping;
        }
    return null;
    }
View Full Code Here

            final List<String> urlMappingList, final Servlet servlet)
    {

        if (urlMappingList.size() > 0)
        {
            ServletMapping mapping = findServletMapping(webApp, servlet);
            if (mapping == null)
            {
                mapping = WebFactory.eINSTANCE
                        .createServletMapping();
                mapping.setServletName(servlet.getServletName());
                webApp.getServletMappings().add(mapping);
            }
            // Add patterns
            for (final String pattern : urlMappingList)
            {
                if (!(doesServletMappingPatternExist(webApp, servlet, pattern)))
                {
                    UrlPatternType urlPattern = JavaeeFactory.eINSTANCE
                            .createUrlPatternType();
                    urlPattern.setValue(pattern);
                    mapping.getUrlPatterns().add(urlPattern);
                }
            }
        }
    }
View Full Code Here

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

     */
    public static void updateServletMappings(final WebApp webApp,
            final Servlet servlet, final String displayName)
    {
        // update mappings for new name
        ServletMapping mapping = findServletMapping(webApp, servlet);
        if (mapping != null)
        {
            mapping.setServletName(displayName);
        }
    }
View Full Code Here

     * @param servlet
     * @return List of mappings
     */
    public static ServletMapping findServletMapping(final WebApp webApp, final Servlet servlet) {
    for (Iterator it=webApp.getServletMappings().iterator();it.hasNext();){
      ServletMapping mapping = (ServletMapping)it.next();
      if (mapping.getServletName() != null &&
          servlet.getServletName() != null &&
          mapping.getServletName().trim().equals(servlet.getServletName().trim()))
        return mapping;
        }
    return null;
    }
View Full Code Here

            final List<String> urlMappingList, final Servlet servlet)
    {

        if (urlMappingList.size() > 0)
        {
            ServletMapping mapping = findServletMapping(webApp, servlet);
            if (mapping == null)
            {
                mapping = WebFactory.eINSTANCE
                        .createServletMapping();
                mapping.setServletName(servlet.getServletName());
                webApp.getServletMappings().add(mapping);
            }
            // Add patterns
            for (final String pattern : urlMappingList)
            {
                if (!(doesServletMappingPatternExist(webApp, servlet, pattern)))
                {
                    UrlPatternType urlPattern = JavaeeFactory.eINSTANCE
                            .createUrlPatternType();
                    urlPattern.setValue(pattern);
                    mapping.getUrlPatterns().add(urlPattern);
                }
            }
        }
    }
View Full Code Here

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

TOP

Related Classes of org.eclipse.jst.javaee.web.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.