Well I just struggled mightily to get my web security working for the
past 3 weeks with shiro 1.1 with a web.xml configuration and embedded
Jetty, so I am not likely to reimplement anything and start all over
with a new set of challenges....
Can shiro web 1.2 be used in conjuntion with Shiro core 1.1 which the
rest of our application uses?
Thanks
On 2/6/2012 2:08 PM, Les Hazlewood wrote:
Oh sorry Chris - this is 1.2. You could replicate this 1.2 feature
into a 1.1 subclass however. Is there any reason why you can't run
1.2? It is recommended to upgrade if you can.
Regards,
Les
On Tue, Feb 7, 2012 at 3:32 AM, Chris Richmond<[email protected]> wrote:
This is in 1.1.0? (not using 1.2.0)
Chris
On 2/6/2012 12:28 PM, Les Hazlewood wrote:
Hi Chris,
You can set (programmatically):
shiroFilter.setEnabled(false); and it will allow all requests through
unfiltered.
One way of implementing this support is to do the following:
If you create a subclass of ShiroFilter you can override init() method
to look for a servlet init param and react accordingly.
For example:
@Override
public void init() throws Exception {
String paramValue = getInitParam("enabled");
if (paramValue != null) {
if ("false'.equalsIgnoreCase(paramValue)) {
setEnabled(false);
}
}
super.init();
}
Then add an init param:
<filter>
<filter-name>ShiroFilter</filter-name>
<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
<init-param>
<param-name>enabled</param-name>
<param-value>false</param-value>
</init-param>
</filter>
It's just an idea. However you choose to call the setEnabled method
is up to you.
HTH,