gpt4 book ai didi

org.eclipse.jst.j2ee.webapplication.WebApp.getServletMappings()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 16:05:05 26 4
gpt4 key购买 nike

本文整理了Java中org.eclipse.jst.j2ee.webapplication.WebApp.getServletMappings()方法的一些代码示例,展示了WebApp.getServletMappings()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebApp.getServletMappings()方法的具体详情如下:
包路径:org.eclipse.jst.j2ee.webapplication.WebApp
类名称:WebApp
方法名:getServletMappings

WebApp.getServletMappings介绍

暂无

代码示例

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.ui

public Collection getChildren(Object object) {
  Object webApp = weakWebApp.get();
  if (null != webApp) {
    return ((WebApp) webApp).getServletMappings();
  }
  return Collections.EMPTY_LIST;
}

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core

/**
 * 
 */
private void validateUrlPattern() {
  List servletMappings = webDD.getServletMappings();
  for (int i = 0; i < servletMappings.size(); i++) {
    ServletMapping mapping = (ServletMapping) servletMappings.get(i);
    String urlPattern = mapping.getUrlPattern();
    int newLineChar = urlPattern.indexOf(Character.LINE_SEPARATOR);
    if (newLineChar != -1) {
      String[] parms = new String[2];
      parms[0] = urlPattern;
      parms[1] = mapping.getServlet().getDisplayName();
      addError(WAR_CATEGORY, MESSAGE_URL_PATTERN_END_WITH_CARRAIGE_RETURN, parms, mapping);
    }
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core

/**
 * Returns an unmodifiable list of the mappings that this
 * servlet participates in.  Since servletMappings is not
 * a bi-directional attribute, if you want to add or delete a
 * mapping, this must be done in the web-app.
 * @return java.util.List
 */
public List getMappings() {
  WebApp webApp = (WebApp) eContainer();
  if (webApp == null) return new BasicEList(0);
  
  EList allMappings = webApp.getServletMappings();
  Iterator i = allMappings.iterator();
  List mappings = new Vector();
  while (i.hasNext()) {
    ServletMapping mapping = (ServletMapping) i.next();
    if (mapping.getServlet() == this)
      mappings.add(mapping);
  }
  return mappings;
}
/**

代码示例来源:origin: org.eclipse/org.eclipse.jst.jsf.core

private static boolean doesServletMappingExist(final WebApp webApp, final Servlet servlet,
    final String pattern) {	
  
  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().equals(servletName) &&
          mapping.getUrlPattern().equals(pattern)) {
        return true;
      }
    }
  }
  return false;
}

代码示例来源:origin: org.eclipse/org.eclipse.jst.jsf.core

/**
 * Removes servlet-mappings for servlet using servlet-name.
 * @param webApp
 * @param servlet
 */
public static void removeURLMappings(WebApp webApp, 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()
            .equals(servletName)) {
        mappings.remove(mapping);
      }
    }
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jst.jsf.core

/**
 * Creates servlet-mappings for the servlet
 * 
 * @param webApp
 * @param urlMappingList - list of string values to  be used in url-pattern for servlet-mapping
 * @param servlet
 */
public static void setUpURLMappings(WebApp webApp, List urlMappingList,
    Servlet servlet) {
  // 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);
    }
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.core

/**
 * WAR validation is driven by 3 prong approach: o XML/DTD validation (this is now handled by
 * the XML Validator) o Consistent web.xml data entry validation beyond DTD e.g., duplicate
 * entries, null entries etc. This is also driven by this validator. o web.xml reference to
 * resources in the "file system". This will not be provided by this validator. In the workbench
 * this function is already provided by the link builder.
 * 
 */
public void validate() throws ValidationException {
  validateMimeMapping();
  validateContextParameters();
  validateTagLibs();
  validateServletMappings(webDD.getServletMappings());
  validateWelcomeFileList(webDD.getFileList());
  validateErrorPages(webDD.getErrorPages());
  validateSecurityAndServlets();
  validateFilters(webDD.getFilters());
  validateFilterMappings(webDD.getFilterMappings());
  validateRefs();
  validateLoginConfig(webDD.getLoginConfig());
  validateEnvironmentEntries(webDD.getEnvironmentProperties());
  validateOther();
  validate14();
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com