Package org.eclipse.jst.j2ee.webapplication

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


      // Create the servlet instance and set up the parameters from data
      // model
      servlet = WebapplicationFactory.eINSTANCE.createServlet();
      servlet.setServletName(CLICK_SERVLET_NAME);

      ServletType servletType = WebapplicationFactory.eINSTANCE.createServletType();
      if(useSpring){
        servletType.setClassName(CLICK_SPRING_SERVLET_CLASS);
//        if (webApp.getJ2EEVersionID() >= J2EEVersionConstants.J2EE_1_4_ID) {
//          // J2EE 1.4
//          ParamValue initParam = CommonFactory.eINSTANCE.createParamValue();
//          initParam.setName("spring-path");
//          initParam.setValue("/applicationContext.xml");
//          servlet.getInitParams().add(initParam);
//        } else {
//          // J2EE 1.2 or 1.3
//          InitParam initParam = WebapplicationFactory.eINSTANCE.createInitParam();
//          initParam.setParamName("spring-path");
//          initParam.setParamValue("/applicationContext.xml");
//          servlet.getParams().add(initParam);
//        }
      } else {
        servletType.setClassName(CLICK_SERVLET_CLASS);
      }
      servlet.setWebType(servletType);
      servlet.setLoadOnStartup(new Integer(1));
     
      // Add the servlet to the web application model
View Full Code Here


      WebapplicationFactory factory = WebapplicationFactory.eINSTANCE;

      Servlet servlet = factory.createServlet();
      servlet.setServletName(getTypeName());

      ServletType servletType = factory.createServletType();
      servletType.setClassName(getPackageFragment().getElementName() + '.' + getTypeName() + "Impl");
      servlet.setWebType(servletType);

      IVirtualComponent component = ComponentCore.createComponent(Util.getProject(projectText));
      WebArtifactEdit artifactEdit = WebArtifactEdit.getWebArtifactEditForWrite(component);
      WebApp webApp = (WebApp) artifactEdit.getContentModelRoot();
View Full Code Here

      WebapplicationFactory factory = WebapplicationFactory.eINSTANCE;

      Servlet servlet = factory.createServlet();
      servlet.setServletName(getTypeName());

      ServletType servletType = factory.createServletType();
      servletType.setClassName(getPackageFragment().getElementName() + '.' + getTypeName() + "Impl");
      servlet.setWebType(servletType);

      IVirtualComponent component = ComponentCore.createComponent(Util.getProject(projectText));
      WebArtifactEdit artifactEdit = WebArtifactEdit.getWebArtifactEditForWrite(component);
      WebApp webApp = (WebApp) artifactEdit.getContentModelRoot();
View Full Code Here

      WebapplicationFactory factory = WebapplicationFactory.eINSTANCE;

      Servlet servlet = factory.createServlet();
      servlet.setServletName(getTypeName());

      ServletType servletType = factory.createServletType();
      servletType.setClassName(getPackageFragment().getElementName() + '.' + getTypeName() + "Impl");
      servlet.setWebType(servletType);

      IVirtualComponent component = ComponentCore.createComponent(Util.getProject(projectText));
      WebArtifactEdit artifactEdit = WebArtifactEdit.getWebArtifactEditForWrite(component);
      WebApp webApp = (WebApp) artifactEdit.getContentModelRoot();
View Full Code Here

      WebapplicationFactory factory = WebapplicationFactory.eINSTANCE;

      Servlet servlet = factory.createServlet();
      servlet.setServletName(getTypeName());

      ServletType servletType = factory.createServletType();
      servletType.setClassName(getPackageFragment().getElementName() + '.' + getTypeName() + "Impl");
      servlet.setWebType(servletType);

      IVirtualComponent component = ComponentCore.createComponent(Util.getProject(projectText));
      WebArtifactEdit artifactEdit = WebArtifactEdit.getWebArtifactEditForWrite(component);
      WebApp webApp = (WebApp) artifactEdit.getContentModelRoot();
View Full Code Here

        try
        {
          final WebApp root = artifact.getWebApp();
 
          final Servlet servlet = WebapplicationFactory.eINSTANCE.createServlet();
          final ServletType servletType = WebapplicationFactory.eINSTANCE.createServletType();
          servletType.setClassName( "com.formgen.core.FormGenServlet" );
          servlet.setWebType( servletType );
          servlet.setServletName( "FormGenServlet" );
          root.getServlets().add( servlet );
 
          final ServletMapping mapping
View Full Code Here

            // Create the servlet instance and set up the parameters from data
            // model
            servlet = WebapplicationFactory.eINSTANCE.createServlet();
            servlet.setServletName(displayName);

            ServletType servletType = WebapplicationFactory.eINSTANCE
                    .createServletType();
            servletType.setClassName(className);
            servlet.setWebType(servletType);
            servlet.setLoadOnStartup(Integer.valueOf(1));
            // Add the servlet to the web application model
            webApp.getServlets().add(servlet);
        }
View Full Code Here

            // Create the servlet instance and set up the parameters from data
            // model
            servlet = WebapplicationFactory.eINSTANCE.createServlet();
            servlet.setServletName(displayName);

            ServletType servletType = WebapplicationFactory.eINSTANCE
                    .createServletType();
            servletType.setClassName(className);
            servlet.setWebType(servletType);
            servlet.setLoadOnStartup(Integer.valueOf(1));
            // Add the servlet to the web application model
            webApp.getServlets().add(servlet);
        }
View Full Code Here

      // Create the servlet instance and set up the parameters from data
      // model
      servlet = WebapplicationFactory.eINSTANCE.createServlet();
      servlet.setServletName(CLICK_SERVLET_NAME);

      ServletType servletType = WebapplicationFactory.eINSTANCE.createServletType();
      if(useSpring){
        servletType.setClassName(CLICK_SPRING_SERVLET_CLASS);
//        if (webApp.getJ2EEVersionID() >= J2EEVersionConstants.J2EE_1_4_ID) {
//          // J2EE 1.4
//          ParamValue initParam = CommonFactory.eINSTANCE.createParamValue();
//          initParam.setName("spring-path");
//          initParam.setValue("/applicationContext.xml");
//          servlet.getInitParams().add(initParam);
//        } else {
//          // J2EE 1.2 or 1.3
//          InitParam initParam = WebapplicationFactory.eINSTANCE.createInitParam();
//          initParam.setParamName("spring-path");
//          initParam.setParamValue("/applicationContext.xml");
//          servlet.getParams().add(initParam);
//        }
      } else {
        servletType.setClassName(CLICK_SERVLET_CLASS);
      }
      servlet.setWebType(servletType);
      servlet.setLoadOnStartup(new Integer(1));

      // Add the servlet to the web application model
View Full Code Here

      // Create the servlet instance and set up the parameters from data
      // model
      servlet = WebapplicationFactory.eINSTANCE.createServlet();
      servlet.setServletName(CLICK_SERVLET_NAME);

      ServletType servletType = WebapplicationFactory.eINSTANCE.createServletType();
      if(useSpring){
        servletType.setClassName(CLICK_SPRING_SERVLET_CLASS);
//        if (webApp.getJ2EEVersionID() >= J2EEVersionConstants.J2EE_1_4_ID) {
//          // J2EE 1.4
//          ParamValue initParam = CommonFactory.eINSTANCE.createParamValue();
//          initParam.setName("spring-path");
//          initParam.setValue("/applicationContext.xml");
//          servlet.getInitParams().add(initParam);
//        } else {
//          // J2EE 1.2 or 1.3
//          InitParam initParam = WebapplicationFactory.eINSTANCE.createInitParam();
//          initParam.setParamName("spring-path");
//          initParam.setParamValue("/applicationContext.xml");
//          servlet.getParams().add(initParam);
//        }
      } else {
        servletType.setClassName(CLICK_SERVLET_CLASS);
      }
      servlet.setWebType(servletType);
      servlet.setLoadOnStartup(new Integer(1));
     
      // Add the servlet to the web application model
View Full Code Here

TOP

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

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.