Announcement Announcement Module
Collapse
No announcement yet.
Using namespace and configuring HttpSessionContextIntegrationFilter Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using namespace and configuring HttpSessionContextIntegrationFilter

    I can't figure out how to configure the automatically created HttpSessionContextIntegrationFilter bean in a namespace configuration scenario.

    What I mean is that I'm using the spring security namespace "http" tag to easily define configurations for my application. What I'd like to do is to configure the "contextClass" property of the HttpSessionContextIntegrationFilter that is automatically created when using the http tag with no other specifications regarding filters.

    Any idea or suggestion?

    Thanks a lot,
    Christian

  • #2
    I'll try to be more explicit.

    I've defined a set of intercept-url using the http element, as follows:

    Code:
    <security:http >
    	<security:intercept-url pattern="/login.view*" access="ROLE_ANONYMOUS" requires-channel="https" />
    	<security:intercept-url pattern="/**" access="ROLE_USER" />
    	
    	<security:form-login
    		login-page="/login.view"
    		default-target-url="/home.view"
    		authentication-failure-url="/login.view?failed=true"/>
    		
    	<security:anonymous
    		granted-authority="ROLE_ANONYMOUS" />
    </security:http>
    What I'd like to do is to explicitly set the "contextClass" property of the automatically created HttpSessionContextIntegrationFilter.
    I've tried to redefine it in the following way:

    Code:
    <bean id="httpSessionContextIntegrationFilter"
    	class="org.springframework.security.context.HttpSessionContextIntegrationFilter">
    	<property name="contextClass"
    		value="org.example.myContextClass" />
    	
    	<security:custom-filter position="SESSION_CONTEXT_INTEGRATION_FILTER"/>
    </bean>
    but what I get at the application startup is this:
    Filters 'org.springframework.security.context.HttpSessionC ontextIntegrationFilter[ order=200; ]' and 'org.springframework.security.context.HttpSessionC ontextIntegrationFilter[ order=200; ]' have the same 'order' value. When using custom filters, please make sure the positions do not conflict with default filters. Alternatively you can disable the default filters by removing the corresponding child elements from <http> and avoiding the use of <http auto-config='true'>.

    I really can't see how to redefine that property, any suggestion?

    thanks,
    Christian.

    Comment

    Working...
    X