當前位置: 首頁>>代碼示例>>Java>>正文


Java DelegatingFilterProxy.setTargetFilterLifecycle方法代碼示例

本文整理匯總了Java中org.springframework.web.filter.DelegatingFilterProxy.setTargetFilterLifecycle方法的典型用法代碼示例。如果您正苦於以下問題:Java DelegatingFilterProxy.setTargetFilterLifecycle方法的具體用法?Java DelegatingFilterProxy.setTargetFilterLifecycle怎麽用?Java DelegatingFilterProxy.setTargetFilterLifecycle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.web.filter.DelegatingFilterProxy的用法示例。


在下文中一共展示了DelegatingFilterProxy.setTargetFilterLifecycle方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onStartup

import org.springframework.web.filter.DelegatingFilterProxy; //導入方法依賴的package包/類
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
	Map<String, String> filterChainDefinitionMap = Application.getSecurityFilterChainDefinitionMap();
	filterChainDefinitionMap.put("/admin", DefaultFilter.authc.name());
	filterChainDefinitionMap.put("/admin/logout", DefaultFilter.logout.name());
	filterChainDefinitionMap.put("/admin/**", DefaultFilter.authc.name());

	List<Filter> filters = Application.getFilters();

	DelegatingFilterProxy shiroFilter = new DelegatingFilterProxy("shiroFilter");
	shiroFilter.setTargetFilterLifecycle(true);
	filters.add(shiroFilter);

	filters.add(new RequestContextFilter());
	filters.add(new CharacterEncodingFilter("UTF-8", true));
}
 
開發者ID:xiangxik,項目名稱:java-platform,代碼行數:17,代碼來源:CentralizeInitializer.java

示例2: onStartup

import org.springframework.web.filter.DelegatingFilterProxy; //導入方法依賴的package包/類
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
    CharacterEncodingFilter filter = new CharacterEncodingFilter();
    filter.setEncoding("UTF-8");
    filter.setForceEncoding(true);
    servletContext.addFilter("characterEncodingFilter", filter).addMappingForUrlPatterns(null, false, "/*");

    servletContext.addFilter("openEntityManagerInViewFilter", new OpenEntityManagerInViewFilter()).addMappingForUrlPatterns(null, false, "/*");

    DelegatingFilterProxy delegatingFilterProxy = new DelegatingFilterProxy();
    delegatingFilterProxy.setTargetFilterLifecycle(true);
    servletContext.addFilter("shiroFilter", delegatingFilterProxy).addMappingForUrlPatterns(null, false, "/*");

    servletContext.addServlet("kaptcha", new KaptchaServlet()).addMapping("/kaptcha");

    super.onStartup(servletContext);
}
 
開發者ID:qatang,項目名稱:ctm,代碼行數:18,代碼來源:WebInitializer.java

示例3: delegatingFilterProxy

import org.springframework.web.filter.DelegatingFilterProxy; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean delegatingFilterProxy(){
    FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
    DelegatingFilterProxy proxy = new DelegatingFilterProxy();
    proxy.setTargetFilterLifecycle(true);
    proxy.setTargetBeanName("shiroFilter");
    filterRegistrationBean.setFilter(proxy);
    return filterRegistrationBean;
}
 
開發者ID:egojit8,項目名稱:easyweb,代碼行數:10,代碼來源:ShiroConfiguration.java

示例4: getServletFilters

import org.springframework.web.filter.DelegatingFilterProxy; //導入方法依賴的package包/類
@Override
protected Filter[] getServletFilters() {
    DelegatingFilterProxy filter = new DelegatingFilterProxy("securitySwitchFilter");
    filter.setContextAttribute("org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatcher");
    filter.setTargetFilterLifecycle(true);
    return new Filter[] { filter, new DelegatingFilterProxy("dawgCorsFilter"), new DelegatingFilterProxy("logFilter") };
}
 
開發者ID:Comcast,項目名稱:dawg,代碼行數:8,代碼來源:ServletInitializer.java

示例5: getServletFilters

import org.springframework.web.filter.DelegatingFilterProxy; //導入方法依賴的package包/類
@Override
protected Filter[] getServletFilters() {
    DelegatingFilterProxy filter = new DelegatingFilterProxy("securitySwitchFilter");
    filter.setContextAttribute("org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatcher");
    filter.setTargetFilterLifecycle(true);
    return new Filter[] { filter, new DelegatingFilterProxy("dawgCorsFilter"), new DelegatingFilterProxy("logFilter")};
}
 
開發者ID:Comcast,項目名稱:dawg,代碼行數:8,代碼來源:ServletInitializer.java

示例6: getServletFilters

import org.springframework.web.filter.DelegatingFilterProxy; //導入方法依賴的package包/類
@Override
protected Filter[] getServletFilters() {
    DelegatingFilterProxy filter = new DelegatingFilterProxy("securitySwitchFilter");
    filter.setContextAttribute("org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatcher");
    filter.setTargetFilterLifecycle(true);
    return new Filter[] { filter, new DelegatingFilterProxy("logFilter") };
}
 
開發者ID:Comcast,項目名稱:dawg,代碼行數:8,代碼來源:ServletInitializer.java

示例7: shiroFilterRegistrationBean

import org.springframework.web.filter.DelegatingFilterProxy; //導入方法依賴的package包/類
/**
 * Shiro Core FilterRegistrationBean: Shiro DelegatingFilterProxy
 * 
 * @return
 */
@Bean 
public FilterRegistrationBean shiroFilterRegistrationBean() {
	FilterRegistrationBean filterRegistration = new FilterRegistrationBean();
	DelegatingFilterProxy delegatingFilterProxy = new DelegatingFilterProxy("shiroFilter");
	delegatingFilterProxy.setTargetFilterLifecycle(true);
	filterRegistration.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.INCLUDE,
			DispatcherType.ERROR);
	filterRegistration.setFilter(delegatingFilterProxy);
	List<String> urlPatterns = new ArrayList<String>();
	urlPatterns.add("/*");
	filterRegistration.setUrlPatterns(urlPatterns);
	return filterRegistration;
}
 
開發者ID:ushelp,項目名稱:EasyEE,代碼行數:19,代碼來源:ShiroConfiguration.java

示例8: onStartup

import org.springframework.web.filter.DelegatingFilterProxy; //導入方法依賴的package包/類
@Override
public void onStartup(final ServletContext servletContext) throws ServletException {
    super.onStartup(servletContext);

    servletContext.setSessionTrackingModes(EnumSet.of(COOKIE));

    final DelegatingFilterProxy wroFilter = servletContext.createFilter(DelegatingFilterProxy.class);
    wroFilter.setTargetFilterLifecycle(true);
    wroFilter.setBeanName("wroFilter");

    servletContext.addFilter("wroFilter", wroFilter)
                  .addMappingForUrlPatterns(null, false, "/resources/*");

}
 
開發者ID:martinlau,項目名稱:unidle-old,代碼行數:15,代碼來源:DispatcherServletInitializer.java


注:本文中的org.springframework.web.filter.DelegatingFilterProxy.setTargetFilterLifecycle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。