本文整理匯總了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));
}
示例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);
}
示例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;
}
示例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") };
}
示例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")};
}
示例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") };
}
示例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;
}
示例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/*");
}