shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Milos Kolencik (JIRA)" <>
Subject [jira] Created: (SHIRO-167) getServletContext allways return null with conf via spring (native mode)
Date Thu, 20 May 2010 16:47:20 GMT
getServletContext allways return null with conf via spring (native mode)

                 Key: SHIRO-167
             Project: Shiro
          Issue Type: Bug
          Components: Integration: Spring
    Affects Versions: 1.0.0
         Environment: sun java, jetty 8.0.0, servelt 3.0 api, win 7
            Reporter: Milos Kolencik
             Fix For: 1.0.0

i am using shiro rev. 945078, with configuration which uses native sessions

filter is configured via springframework - DelegatingFilterProxy

(here is the snippet from web.xml)


(and here from spring conf. xml)

	<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
	    <property name="securityManager" ref="securityManager"/>
	<bean id="securityManager" class="org.apache.shiro.web.DefaultWebSecurityManager">
		<property name="realm" ref="trustRealm" />
		<property name="subjectFactory" ref="trustSubjectFactory" />
		<property name="sessionMode" value="native" />
		<property name="sessionManager" ref="trustSessionManager" />
		<property name="cacheManager">
			<bean class="org.apache.shiro.cache.MemoryConstrainedCacheManager" />

the problem i have is that the method HttpServletRequest.getSession().getServletContext()
always return null,

(I was wondering why and i found that the ServletContext is set to AbstractFilter only in
init(filterConfig) method.
But this method is never called in configuration via spring-DelegatingFilterProxy. I know
that specifying the "targetFilterLifecycle" filter init-param as "true" will enforce invocation
of the Filter.init. But this way my definitions will be overrided.)

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message