Spring Framework RequestContextListener - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework RequestContextListener class.

This code example shows how to use the following methods:requestDestroyed, requestInitialized
		VRaptorRequestHolder.setRequestForCurrentThread(request); 
		T result; 
		try { 
			ServletContext context = request.getServletContext(); 
			HttpServletRequest webRequest = request.getRequest(); 
			requestListener.requestInitialized(new ServletRequestEvent(context, webRequest)); 
			try { 
				result = execution.insideRequest(getContainer()); 
			} finally { 
				requestListener.requestDestroyed(new ServletRequestEvent(context, webRequest)); 
			} 
		} finally { 
			VRaptorRequestHolder.resetRequestForCurrentThread(); 
		} 
		return result; 
	} 
 
	public SpringBasedContainer getContainer() { 
		return container; 
	} 
6
CodeRank
This code example shows how to use the following methods:
	} 
 
	private void registerListener(ServletContext servletContext) { 
		AnnotationConfigWebApplicationContext rootContext = createContext(configurationClasses); 
		servletContext.addListener(new ContextLoaderListener(rootContext)); 
		servletContext.addListener(new RequestContextListener()); 
	} 
 
	private void registerOpenEntityManagerInViewFilter(ServletContext servletContext) { 
		FilterRegistration.Dynamic registration = servletContext.addFilter("openEntityManagerInView", 
				new OpenEntityManagerInViewFilter()); 
		registration.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD), false, 
				"*.htm"); 
		registration.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD), false, 
				"/j_spring_security_check"); 
	} 
 
	private void registerSpringSecurityFilterChain(ServletContext servletContext) { 
		FilterRegistration.Dynamic springSecurityFilterChain = servletContext.addFilter( 
				BeanIds.SPRING_SECURITY_FILTER_CHAIN, new DelegatingFilterProxy()); 
5
CodeRank
This code example shows how to use the following methods:
		 
		//System.out.println("CONTEXTPATH " + servletContext.getContextPath()); 
		 
		// Manage the lifecycle of the root application context 
		servletContext.addListener(new ContextLoaderListener(rootContext)); 
		servletContext.addListener(new RequestContextListener()); 
		 
		{ 
            FilterRegistration.Dynamic fr = servletContext.addFilter("CorsFilter", new CorsFilter()); 
            fr.addMappingForUrlPatterns(null, true, "/*"); 
		} 
		 
		{ 
    		FilterRegistration.Dynamic fr = servletContext.addFilter("UrlRewriteFilter", new UrlRewriteFilter()); 
    		fr.setInitParameter("dispatcher", "REQUEST"); 
    		fr.setInitParameter("dispatcher", "FORWARD"); 
    		fr.addMappingForUrlPatterns(null, true, "/*"); 
		} 
		 
		// Create the dispatcher servlet's Spring application context 
5
CodeRank
This code example shows how to use the following methods:
 
    @Bean 
    @ConditionalOnMissingBean(RequestContextListener.class) 
    public RequestContextListener requestContextListener() { 
 
        return new RequestContextListener(); 
    } 
 
    @Bean 
    @UIScope 
    public VaadinSpringExampleUi exampleUi() { 
 
        return new VaadinSpringExampleUi(helloService()); 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:
		AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext(); 
		rootContext.register(AppConfig.class); 
		 
		// Manage the lifecycle of the root application context 
		servletContext.addListener(new ContextLoaderListener(rootContext)); 
		servletContext.addListener(new RequestContextListener()); 
 
		{ 
		    FilterRegistration.Dynamic fr = servletContext.addFilter("CorsFilter", new CorsFilter()); 
		    fr.addMappingForUrlPatterns(null, true, "/*"); 
        //  fr.setInitParameter("dispatcher", "REQUEST"); 
		} 
		 
//	    { 
//            FilterRegistration.Dynamic fr = servletContext.addFilter("UrlRewriteFilter", new UrlRewriteFilter()); 
//            fr.setInitParameter("dispatcher", "REQUEST"); 
//            fr.setInitParameter("dispatcher", "FORWARD"); 
//            fr.addMappingForUrlPatterns(null, true, "/*"); 
//	    } 
 
5
CodeRank
This code example shows how to use the following methods:
        super.onStartup(servletContext); 
        this.registerRequestContextListener(servletContext); 
    } 
 
    private void registerRequestContextListener(ServletContext servletContext) { 
        servletContext.addListener(new RequestContextListener()); 
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:
import javax.servlet.annotation.WebListener; 
 
import org.springframework.web.context.request.RequestContextListener; 
 
@WebListener 
public class SpringRequestContextListener extends RequestContextListener { 
} 
4
CodeRank