Examples of Webapp


Examples of org.apache.openejb.jee.WebApp

      // look at section 10.4.2 of the JSF v1.2 spec, bullet 1 for details
      Set<URL> facesConfigLocations = new HashSet<URL>();

        // web.xml contains faces config locations in the context parameter javax.faces.CONFIG_FILES
        File warFile = new File(webModule.getJarLocation());
        WebApp webApp = webModule.getWebApp();
        if (webApp != null) {
            List<ParamValue> contextParam = webApp.getContextParam();
            for (ParamValue value : contextParam) {
        boolean foundContextParam = value.getParamName().trim().equals("javax.faces.CONFIG_FILES");
        if(foundContextParam){
          // the value is a comma separated list of config files
          String commaDelimitedListOfFiles = value.getParamValue().trim();
View Full Code Here

Examples of org.apache.openejb.jee.WebApp

            descriptors = getWebDescriptors(warFile);
        } catch (IOException e) {
            throw new OpenEJBException("Unable to determine descriptors in jar.", e);
        }

        WebApp webApp = null;
        URL webXmlUrl = descriptors.get("web.xml");
        if (webXmlUrl != null){
            webApp = ReadDescriptors.readWebApp(webXmlUrl);
        }

        // if this is a standalone module (no-context root), and webApp.getId is set then that is the module name
        if (contextRoot == null && webApp != null && webApp.getId() != null) {
            moduleName = webApp.getId();
        }

        // determine war class path
        List<URL> webClassPath = new ArrayList<URL>();
        File webInfDir = new File(warFile, "WEB-INF");
View Full Code Here

Examples of org.apache.openejb.jee.WebApp

    private static void addTagLibraries(WebModule webModule) throws OpenEJBException {
        Set<URL> tldLocations = new HashSet<URL>();

        // web.xml contains tag lib locations in nested jsp config elements
        File warFile = new File(webModule.getJarLocation());
        WebApp webApp = webModule.getWebApp();
        if (webApp != null) {
            for (JspConfig jspConfig : webApp.getJspConfig()) {
                for (Taglib taglib : jspConfig.getTaglib()) {
                    String location = taglib.getTaglibLocation();
                    if (!location.startsWith("/")) {
                        // this reproduces a tomcat bug
                        location = "/WEB-INF/" + location;
View Full Code Here

Examples of org.apache.openejb.jee.WebApp

    public void testConfigureApplicationWebModule() throws OpenEJBException {
        SystemInstance.get().setProperty(ConfigurationFactory.VALIDATION_SKIP_PROPERTY, "false");
        SystemInstance.get().setProperty(DeploymentsResolver.SEARCH_CLASSPATH_FOR_DEPLOYMENTS_PROPERTY, "false");
        ConfigurationFactory factory = new ConfigurationFactory();
        final String moduleId = "testConfigureApplicationWebModule";
        WebApp webApp = new WebApp();
        // no real classes engaged so disable metadata (annotation) processing
        webApp.setMetadataComplete(true);
        WebModule webModule = new WebModule(webApp, null, null, "/some/where.war", moduleId);
        WebAppInfo info = factory.configureApplication(webModule);
        assertEquals(moduleId, info.moduleId);
    }
View Full Code Here

Examples of org.apache.openejb.jee.WebApp

            }
        }


        // map existing servlet-mapping declarations
        WebApp webApp = webModule.getWebApp();
        Map<String, ServletMapping> servletMappings = new TreeMap<String, ServletMapping>();
        for (ServletMapping servletMapping : webApp.getServletMapping()) {
            servletMappings.put(servletMapping.getServletName(), servletMapping);
        }

        // add port declarations for webservices
        WebserviceDescription webserviceDescription;
        for (Servlet servlet : webApp.getServlet()) {
            String className = servlet.getServletClass();

            // Skip JSPs
            if (className == null) continue;

            try {
                Class<?> clazz = webModule.getClassLoader().loadClass(className);
                if (JaxWsUtils.isWebService(clazz)) {
                    // add servlet mapping if not already declared
                    ServletMapping servletMapping = servletMappings.get(servlet.getServletName());
                    String serviceName = JaxWsUtils.getServiceName(clazz);
                    if (servletMapping == null) {
                        servletMapping = new ServletMapping();
                        servletMapping.setServletName(servlet.getServletName());

                        String location = "/" + serviceName;
                        servletMapping.getUrlPattern().add(location);
                        webApp.getServletMapping().add(servletMapping);
                    }

                    // if we don't have a webservices document yet, we're gonna need one now
                    if (webservices == null) {
                        webservices = new Webservices();
View Full Code Here

Examples of org.apache.openejb.jee.WebApp

        }
    }

    private void buildWebModules(AppModule appModule, JndiEncInfoBuilder jndiEncInfoBuilder, AppInfo appInfo) throws OpenEJBException {
        for (WebModule webModule : appModule.getWebModules()) {
            WebApp webApp = webModule.getWebApp();
            WebAppInfo webAppInfo = new WebAppInfo();
            webAppInfo.description = webApp.getDescription();
            webAppInfo.displayName = webApp.getDisplayName();
            webAppInfo.codebase = webModule.getJarLocation();
            webAppInfo.moduleId = webModule.getModuleId();
            webAppInfo.watchedResources.addAll(webModule.getWatchedResources());

            webAppInfo.host = webModule.getHost();
View Full Code Here

Examples of org.apache.openejb.jee.WebApp$JAXB

    }

    public static WebApp unmarshal(final URL url) throws Exception {
        final InputStream inputStream = IO.read(url);
        try {
            return Sxc.unmarshalJavaee(new WebApp$JAXB(), inputStream);
        } finally {
            IO.close(inputStream);
        }
    }
View Full Code Here

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

  private void createServletAndModifyWebXML(
      IProject project, final IDataModel config,IProgressMonitor monitor,
      boolean useSpring, boolean useCayenne, boolean usePerformanceFilter) {

    WebApp webApp = null;
    WebArtifactEdit artifactEdit = null;
    try {
      artifactEdit = ClickUtils.getWebArtifactEditForWrite(project);
      webApp = artifactEdit.getWebApp();

      // create or update servlet ref
      Servlet servlet = ClickUtils.findClickServlet(webApp, useSpring);
      if (servlet != null) {
        // remove old mappings
        ClickUtils.removeURLMappings(webApp, servlet);
      }

      servlet = ClickUtils.createOrUpdateServletRef(webApp, config, servlet, useSpring);

      if(useSpring){
        ParamValue contextParam = CommonFactory.eINSTANCE.createParamValue();
        contextParam.setName("contextConfigLocation");
        contextParam.setValue("WEB-INF/spring-beans.xml");
        webApp.getContextParams().add(contextParam);

        Listener listener = CommonFactory.eINSTANCE.createListener();
        listener.setListenerClassName("org.springframework.web.context.ContextLoaderListener");
        webApp.getListeners().add(listener);
      }

      // Add PerformanceFilter
      if(usePerformanceFilter){
        Filter filter = WebapplicationFactory.eINSTANCE.createFilter();
        filter.setName("PerformanceFilter");
        filter.setFilterClassName("org.apache.click.extras.filter.PerformanceFilter");

        if (webApp.getJ2EEVersionID() >= J2EEVersionConstants.J2EE_1_4_ID) {
          // J2EE 1.4
          ParamValue initParam = CommonFactory.eINSTANCE.createParamValue();
          initParam.setName("cachable-paths");
          initParam.setValue("/assets/*");
          filter.getInitParamValues().add(initParam);
        } else {
          // J2EE 1.2 or 1.3
          InitParam initParam = WebapplicationFactory.eINSTANCE.createInitParam();
          initParam.setParamName("cachable-paths");
          initParam.setParamValue("/assets/*");
          filter.getInitParams().add(initParam);
        }

        webApp.getFilters().add(filter);

        FilterMapping mapping = WebapplicationFactory.eINSTANCE.createFilterMapping();
        mapping.setServletName(servlet.getServletName());
        mapping.setFilter(filter);
        webApp.getFilterMappings().add(mapping);

        String[] filterPatterns = {"*.css", "*.js", "*.gif", "*.png"};
        for(String pattern: filterPatterns){
          mapping = WebapplicationFactory.eINSTANCE.createFilterMapping();
          mapping.setFilter(filter);
          mapping.setUrlPattern(pattern);
          webApp.getFilterMappings().add(mapping);
        }
      }

      // init mappings
      String[] listOfMappings = {"*.htm"};
      ClickUtils.setUpURLMappings(webApp, listOfMappings, servlet);

      // welcome-file-list
      ClickUtils.createOrUpdateFilelist(webApp);

      // Add Cayenne Support
      if(useCayenne){
        Filter filter = WebapplicationFactory.eINSTANCE.createFilter();
        filter.setFilterClassName(ClickUtils.CAYENNE_FILTER_CLASS);
        filter.setName("DataContextFilter");

        if (webApp.getJ2EEVersionID() >= J2EEVersionConstants.J2EE_1_4_ID) {
          // J2EE 1.4
          ParamValue initParam = CommonFactory.eINSTANCE.createParamValue();
          initParam.setName("session-scope");
          initParam.setValue("false");
          filter.getInitParamValues().add(initParam);
        } else {
          // J2EE 1.2 or 1.3
          InitParam initParam = WebapplicationFactory.eINSTANCE.createInitParam();
          initParam.setParamName("session-scope");
          initParam.setParamValue("false");
          filter.getInitParams().add(initParam);
        }

        webApp.getFilters().add(filter);

        FilterMapping mapping = WebapplicationFactory.eINSTANCE.createFilterMapping();
        mapping.setServletName(servlet.getServletName());
        mapping.setFilter(filter);
        webApp.getFilterMappings().add(mapping);
      }
    } catch(Exception ex){
      ClickPlugin.log(ex);
    } finally {
      if (artifactEdit != null) {
View Full Code Here

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

      this.config = config;
      this.jsfUtil = jsfUtil;
    }
   
    public void run() {
      final WebApp webApp = (WebApp) ModelProviderManager.getModelProvider(project).getModelObject();
      jsfUtil.updateWebApp(webApp, config);
    }
View Full Code Here

Examples of org.gatein.wci.WebApp

   public void onEvent(WebAppEvent event)
   {
      if (event instanceof WebAppLifeCycleEvent)
      {
         WebAppLifeCycleEvent lifeCycleEvent = (WebAppLifeCycleEvent)event;
         WebApp webApp = event.getWebApp();
         ServletContext context = webApp.getServletContext();

         // if we see the WSRP admin GUI being deployed or undeployed, inject or remove services
         if (WSRP_ADMIN_GUI_CONTEXT_PATH.equals(webApp.getContextPath()))
         {
            switch (lifeCycleEvent.getType())
            {
               case WebAppLifeCycleEvent.ADDED:
                  context.setAttribute("ConsumerRegistry", consumerRegistry);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.