Examples of ServletContextResource


Examples of org.springframework.web.context.support.ServletContextResource

    @Override
    protected void prepareBeanFactory(ConfigurableListableBeanFactory beanFactory) {
        if (configLocations.length > 0) {
            for (String configLocation : configLocations) {
                BeanBuilder beanBuilder = new BeanBuilder(getParent(),getClassLoader());
                final ServletContextResource resource = new ServletContextResource(getServletContext(), configLocation);
                beanBuilder.loadBeans(resource);
                beanBuilder.registerBeans(this);
            }
        }
        super.prepareBeanFactory(beanFactory);
View Full Code Here

Examples of org.springframework.web.context.support.ServletContextResource

    public Resource getResourceForUri(String uri) {
        GroovyPageScriptSource scriptSource = getResourceWithinContext(uri);
        if (scriptSource != null && (scriptSource instanceof GroovyPageResourceScriptSource)) {
            return ((GroovyPageResourceScriptSource)scriptSource).getResource();
        }
        return new ServletContextResource(servletContext, uri);
    }
View Full Code Here

Examples of org.springframework.web.context.support.ServletContextResource

        String brokerURI = context.getInitParameter(INIT_PARAM_BROKER_URI);
        if (brokerURI == null) {
            brokerURI = "activemq.xml";
        }
        context.log("Loading ActiveMQ Broker configuration from: " + brokerURI);
        Resource resource = new ServletContextResource(context, brokerURI);
        BrokerFactoryBean factory = new BrokerFactoryBean(resource);
        try {
            factory.afterPropertiesSet();
        } catch (Exception e) {
            context.log("Failed to create broker: " + e, e);
View Full Code Here

Examples of org.springframework.web.context.support.ServletContextResource

   * @return context path
   */
  private String getContextPath(Resource rootFile) {
    String contextPath = null;
    if (rootFile instanceof ServletContextResource) {
      ServletContextResource servletResource = (ServletContextResource) rootFile;
      contextPath = servletResource.getServletContext().getContextPath();
      if ("/".equals(contextPath)) {
        contextPath = "/root";
      }
    } else if (resources instanceof IScope) {
      contextPath = ((IScope) resources).getContextPath();
View Full Code Here

Examples of org.springframework.web.context.support.ServletContextResource

            }

        }

        try {
            ServletContextResource resource = new ServletContextResource(sc, iconClassFile);
            FileUtils.writeLines(resource.getFile(), cssList);
        } catch (Exception e) {
            LogUtils.logError("gen icon error", e);
            return "生成失败:" + e.getMessage();
        }
View Full Code Here

Examples of org.springframework.web.context.support.ServletContextResource

            + kurentoPropertiesDir);
        inputStream = new FileInputStream(kurentoPropertiesDir
            + kurentoProperties);
      } else {
        // Third, look for properties in Servlet Context
        ServletContextResource servletContextResource = new ServletContextResource(
            ctx, "/WEB-INF" + kurentoProperties);
        if (servletContextResource.exists()) {
          log.info("Found custom properties in Servlet Context: /WEB-INF"
              + kurentoProperties);
          inputStream = servletContextResource.getInputStream();
        }
      }

      if (inputStream != null) {
        Properties properties = new Properties();
View Full Code Here

Examples of org.springframework.web.context.support.ServletContextResource

   * Return the file timestamp for the given resource.
   * @param resourceUrl the URL of the resource
   * @return the file timestamp in milliseconds, or -1 if not determinable
   */
  protected long getFileTimestamp(String resourceUrl) {
    ServletContextResource resource = new ServletContextResource(getServletContext(), resourceUrl);
    try {
      long lastModifiedTime = resource.lastModified();
      if (logger.isDebugEnabled()) {
        logger.debug("Last-modified timestamp of " + resource + " is " + lastModifiedTime);
      }
      return lastModifiedTime;
    }
View Full Code Here

Examples of org.springframework.web.context.support.ServletContextResource

   * Return the file timestamp for the given resource.
   * @param resourceUrl the URL of the resource
   * @return the file timestamp in milliseconds, or -1 if not determinable
   */
  protected long getFileTimestamp(String resourceUrl) {
    ServletContextResource resource = new ServletContextResource(getServletContext(), resourceUrl);
    try {
      long lastModifiedTime = resource.lastModified();
      if (logger.isDebugEnabled()) {
        logger.debug("Last-modified timestamp of " + resource + " is " + lastModifiedTime);
      }
      return lastModifiedTime;
    }
View Full Code Here

Examples of org.springframework.web.context.support.ServletContextResource

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        appHandler = new ResourceHttpRequestHandler();

        ServletContextResource composerRoot = new ServletContextResource(config.getServletContext(), "/composer/**");
        appHandler.setApplicationContext(getWebApplicationContext());
        appHandler.setLocations((List)Arrays.asList(composerRoot));

    }
View Full Code Here

Examples of org.springframework.web.context.support.ServletContextResource

            brokerURI = "activemq.xml";
        }

        log("Loading ActiveMQ Broker configuration from: " + brokerURI);

        Resource resource = new ServletContextResource(context, brokerURI);
        return SpringBrokerContainerFactory.newInstance(resource);
    }
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.