shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Les Hazlewood (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SHIRO-167) getServletContext allways return null with conf via spring (native mode)
Date Thu, 20 May 2010 17:51:19 GMT

    [ https://issues.apache.org/jira/browse/SHIRO-167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12869695#action_12869695
] 

Les Hazlewood commented on SHIRO-167:
-------------------------------------

Hi Milos,

When you say "But this way my definitions will be overridden" - what definitions are you talking
about?  The Shiro beans created at startup?

> getServletContext allways return null with conf via spring (native mode)
> ------------------------------------------------------------------------
>
>                 Key: SHIRO-167
>                 URL: https://issues.apache.org/jira/browse/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
>
>
> Hi,
> 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)
>  	<filter>
>  		<filter-name>shiroFilter</filter-name>
>  		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
>  	</filter> 
> (and here from spring conf. xml)
> 	<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
> 	    <property name="securityManager" ref="securityManager"/>
> 	</bean>
> 	<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" />
> 		</property>
> 	</bean>
> 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.


Mime
View raw message