protected LiveBeansView buildLiveBeansView() { return new ServletContextLiveBeansView(getServletContext()); }
/** * This implementation supports pattern matching in unexpanded WARs too. * @see ServletContextResourcePatternResolver */ @Override protected ResourcePatternResolver getResourcePatternResolver() { return new ServletContextResourcePatternResolver(this); }
/** * Convenient variant of {@link #initServletPropertySources(MutablePropertySources, * ServletContext, ServletConfig)} that always provides {@code null} for the * {@link ServletConfig} parameter. * @see #initServletPropertySources(MutablePropertySources, ServletContext, ServletConfig) */ public static void initServletPropertySources(MutablePropertySources propertySources, ServletContext servletContext) { initServletPropertySources(propertySources, servletContext, null); }
@Override public void init() throws ServletException { WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext()); this.target = wac.getBean(getServletName(), HttpRequestHandler.class); }
/** * This implementation supports file paths beneath the root of the web application. * @see ServletContextResource */ @Override protected Resource getResourceByPath(String path) { return new ServletContextResource(this.servletContext, path); }
/** * Create a new ServletContextResourcePatternResolver. * @param servletContext the ServletContext to load resources with * @see ServletContextResourceLoader#ServletContextResourceLoader(javax.servlet.ServletContext) */ public ServletContextResourcePatternResolver(ServletContext servletContext) { super(new ServletContextResourceLoader(servletContext)); }
/** * Create and return a new {@link StandardServletEnvironment}. */ @Override protected ConfigurableEnvironment createEnvironment() { return new StandardServletEnvironment(); }
@Override public String getDescription() { StringBuilder sb = new StringBuilder(); sb.append("url=[").append(getRequestUrl()).append("]; "); sb.append("client=[").append(getClientAddress()).append("]; "); sb.append("method=[").append(getMethod()).append("]; "); sb.append("servlet=[").append(getServletName()).append("]; "); sb.append(super.getDescription()); return sb.toString(); }
@Override protected WebApplicationContext createRootApplicationContext() { StaticWebApplicationContext rootContext = new StaticWebApplicationContext(); rootContext.registerSingleton(BEAN_NAME, MyBean.class); return rootContext; } }
/** * This constructor performs injection on this instance, * based on the current web application context. * <p>Intended for use as a base class. * @see #processInjectionBasedOnCurrentContext */ public SpringBeanAutowiringSupport() { processInjectionBasedOnCurrentContext(this); }
/** * Register web-specific scopes ("request", "session", "globalSession") * with the given BeanFactory, as used by the WebApplicationContext. * @param beanFactory the BeanFactory to configure */ public static void registerWebApplicationScopes(ConfigurableListableBeanFactory beanFactory) { registerWebApplicationScopes(beanFactory, null); }
@Override protected void initPropertySources() { WebApplicationContextUtils.initServletPropertySources(getEnvironment().getPropertySources(), this.servletContext, this.servletConfig); }
@Override public final void setServletContext(ServletContext servletContext) { if (servletContext != this.servletContext) { this.servletContext = servletContext; initServletContext(servletContext); } }
/** * This implementation supports pattern matching in unexpanded WARs too. * @see ServletContextResourcePatternResolver */ @Override protected ResourcePatternResolver getResourcePatternResolver() { return new ServletContextResourcePatternResolver(this); }
/** * Create and return a new {@link StandardServletEnvironment}. * <p>Subclasses may override this in order to configure the environment or * specialize the environment type returned. */ protected ConfigurableEnvironment createEnvironment() { return new StandardServletEnvironment(); }
@Override protected WebApplicationContext createServletApplicationContext() { StaticWebApplicationContext servletContext = new StaticWebApplicationContext(); servletContext.registerSingleton("bean", MyBean.class); return servletContext; }
/** * This implementation supports pattern matching in unexpanded WARs too. * @see ServletContextResourcePatternResolver */ @Override protected ResourcePatternResolver getResourcePatternResolver() { return new ServletContextResourcePatternResolver(this); }
/** * Create and return a new {@link StandardServletEnvironment}. Subclasses may override * in order to configure the environment or specialize the environment type returned. */ @Override protected ConfigurableEnvironment createEnvironment() { return new StandardServletEnvironment(); }
/** * Create and return a new {@link StandardServletEnvironment}. */ @Override protected ConfigurableEnvironment createEnvironment() { return new StandardServletEnvironment(); }
/** * Create and return a new {@link StandardServletEnvironment}. * <p>Subclasses may override this in order to configure the environment or * specialize the environment type returned. * @since 4.3.9 */ protected Environment createEnvironment() { return new StandardServletEnvironment(); }