Search in sources :

Example 1 with HttpSessionEventPublisher

use of org.springframework.security.web.session.HttpSessionEventPublisher in project ocvn by devgateway.

the class WebInitializer method onStartup.

@Override
public void onStartup(final ServletContext sc) throws ServletException {
    sc.addFilter("Spring OpenEntityManagerInViewFilter", org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.class).addMappingForUrlPatterns(null, false, "/*");
    FilterRegistration filter = sc.addFilter("wicket-filter", WicketFilter.class);
    filter.setInitParameter(WicketFilter.APP_FACT_PARAM, SpringWebApplicationFactory.class.getName());
    filter.setInitParameter(PARAM_APP_BEAN, "formsWebApplication");
    // This line is the only surprise when comparing to the equivalent
    // web.xml. Without some initialization seems to be missing.
    filter.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*");
    filter.addMappingForUrlPatterns(null, false, "/*");
    // // Request Listener
    sc.addListener(new RequestContextListener());
    sc.addListener(new HttpSessionEventPublisher());
}
Also used : SpringWebApplicationFactory(org.apache.wicket.spring.SpringWebApplicationFactory) RequestContextListener(org.springframework.web.context.request.RequestContextListener) HttpSessionEventPublisher(org.springframework.security.web.session.HttpSessionEventPublisher) FilterRegistration(javax.servlet.FilterRegistration)

Example 2 with HttpSessionEventPublisher

use of org.springframework.security.web.session.HttpSessionEventPublisher in project oc-explorer by devgateway.

the class WebInitializer method onStartup.

@Override
public void onStartup(final ServletContext sc) throws ServletException {
    sc.addFilter("Spring OpenEntityManagerInViewFilter", org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.class).addMappingForUrlPatterns(null, false, "/*");
    FilterRegistration filter = sc.addFilter("wicket-filter", WicketFilter.class);
    filter.setInitParameter(WicketFilter.APP_FACT_PARAM, SpringWebApplicationFactory.class.getName());
    filter.setInitParameter(PARAM_APP_BEAN, "formsWebApplication");
    // This line is the only surprise when comparing to the equivalent
    // web.xml. Without some initialization seems to be missing.
    filter.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*");
    filter.addMappingForUrlPatterns(null, false, "/*");
    // // Request Listener
    sc.addListener(new RequestContextListener());
    sc.addListener(new HttpSessionEventPublisher());
}
Also used : SpringWebApplicationFactory(org.apache.wicket.spring.SpringWebApplicationFactory) RequestContextListener(org.springframework.web.context.request.RequestContextListener) HttpSessionEventPublisher(org.springframework.security.web.session.HttpSessionEventPublisher) FilterRegistration(javax.servlet.FilterRegistration)

Aggregations

FilterRegistration (javax.servlet.FilterRegistration)2 SpringWebApplicationFactory (org.apache.wicket.spring.SpringWebApplicationFactory)2 HttpSessionEventPublisher (org.springframework.security.web.session.HttpSessionEventPublisher)2 RequestContextListener (org.springframework.web.context.request.RequestContextListener)2