You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Diptanu Choudhury <di...@gmail.com> on 2012/10/17 00:35:35 UTC
Custom Ini Instance
Hi Guys,
I am trying to shiro in a web application. And i followed the instructions
on the docs and got it working. However i dont want to use the shiro.ini
anymore, I want to create a Ini class in my code and use it instead. I am
doing the following
<listener>
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class></listener
<context-param>
<param-name>shiroEnvironmentClass</param-name>
<param-value>com.foo.bar.shiro.MyWebEnvironment</param-value></context-param>
And the class com.foo.bar.shiro.MyWebEnvironment looks like this
class MyWebEnvironment extends DefaultWebEnvironment implements
Initializable, Destroyable{
public init(){
Ini ini = new Ini()
WebSecurityManager securityManager = WebIniSecurityManagerFactory(ini);
setObject("securityManager", securityManager);
}
}
I am sure this is wrong on many levels, but i
--
Thanks,
Diptanu Choudhury
Senior Consultant, ThoughtWorks
Mobile - +447808024919
Web - www.linkedin.com/in/diptanu
Twitter - @diptanu <http://twitter.com/diptanu>