Hi Alex,
Not that I can think of - but the new features can sometimes be
leveraged more easily in Spring environments. For example, turning on
or off a filter can be managed by a property value w/
PropertyPlaceholderConfigurer:
<bean id="sslFilter" class="org.apache.shiro.web.filter.authz.SslFilter">
<property name="enabled" value="${ssl.required}"/>
<property name="port" value="${ssl.port}"/>
</bean>
<bean id="shiroFilter"
class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
...
<property name="filters">
<util:map>
<!-- Override Shiro's default SSL Filter with the one
configured above: -->
<entry key="ssl" value-ref="sslFilter"/>
</util:map>
</property>
...
</bean>
This allows for a much more flexible way to configure the SslFilter
than commenting/uncommenting lines in shiro.ini (for example). You
can do this with any filter that extends from OncePerRequestFilter of
course.
It should be noted that Spring environments don't have/need an
Environment/WebEnvironment concept as the 'environment' is essentially
the Spring ApplicationContext - you can just interact with the
ApplicationContext directly if ever needed.
For example, non-Spring applications (or non DI applications) that use
only shiro.ini will need to use WebUtils.getRequiredWebEnvironment if
they need to access a configured PasswordService to perform password
hashing. With Spring or other DI containers (Guice, etc), you can
just create a bean and inject it with the PasswordService directly -
no need to look it up.
Cheers,
--
Les Hazlewood
CTO, Stormpath | http://www.stormpath.com | 888.391.5282
twitter: @lhazlewood | http://twitter.com/lhazlewood
blog: http://leshazlewood.com
On Tue, Mar 13, 2012 at 2:13 PM, Alex Vasilenko <[email protected]> wrote:
> Hi Les,
>
> Thanks for update. Any changes for spring support in 1.2, that not mentioned
> in article http://shiro.apache.org/spring.html?
>
> Thanks,
> Alexandr Vasilenko
>
>
> 2012/3/13 Les Hazlewood <[email protected]>
>>
>> Hi Shiro community,
>>
>> I wanted to get this article out sooner since 1.2 is already released,
>> but things have been insane (in a good way!) at work. Please see the
>> following blog post to see the latest features and enhancements for
>> the Apache Shiro 1.2 release:
>>
>> http://www.stormpath.com/blog/2012/03/12/whats-new-in-apache-shiro-12
>>
>> Enjoy!
>>
>> --
>> Les Hazlewood
>> Katasoft has been renamed to Stormpath!
>> CTO, Stormpath | http://www.stormpath.com | 888.391.5282
>> twitter: @lhazlewood | http://twitter.com/lhazlewood