Package com.google.gdt.eclipse.designer.model.web

Examples of com.google.gdt.eclipse.designer.model.web.WebAppElement


    // search for "welcome-file"
    List<String> welcomeFileNames = Lists.newArrayList();
    try {
      WebDocumentEditContext context = new WebDocumentEditContext(webFile);
      try {
        WebAppElement webApp = context.getWebAppElement();
        for (WelcomeFileListElement welcomeFileList : webApp.getWelcomeFileListElements()) {
          for (WelcomeFileElement welcomeFile : welcomeFileList.getWelcomeFiles()) {
            String welcomeFileName = welcomeFile.getName();
            welcomeFileNames.add(welcomeFileName);
          }
        }
View Full Code Here


    // update web.xml
    String webFolderName = WebUtils.getWebFolderName(project);
    IFile webFile = project.getFile(new Path(webFolderName + "/WEB-INF/web.xml"));
    WebDocumentEditContext context = new WebDocumentEditContext(webFile);
    try {
      WebAppElement moduleElement = context.getWebAppElement();
      // add new servlet definition
      {
        String servletClassName = serverPackageName + "." + serviceName + "Impl";
        String pattern = "/" + module.getName() + "/" + serviceName;
        // servlet
        com.google.gdt.eclipse.designer.model.web.ServletElement servletElement =
            new com.google.gdt.eclipse.designer.model.web.ServletElement();
        moduleElement.addChild(servletElement);
        servletElement.setName(serviceName);
        servletElement.setClassName(servletClassName);
        // servlet-mapping
        com.google.gdt.eclipse.designer.model.web.ServletMappingElement servletMappingElement =
            new com.google.gdt.eclipse.designer.model.web.ServletMappingElement();
        moduleElement.addChild(servletMappingElement);
        servletMappingElement.setName(serviceName);
        servletMappingElement.setPattern(pattern);
      }
      // commit modifications
      context.commit();
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Parses module from {@link IFile}.
   */
  public void test_parseFromFile() throws Exception {
    WebAppElement webElement = WebUtils.readModule(m_webFile);
    List<DocumentElement> elements = webElement.getChildren(DocumentElement.class);
    assertThat(elements).isNotEmpty();
  }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.model.web.WebAppElement

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.