I you are using Spring XML files you can take a look at this example:
https://github.com/apache/shiro/blob/master/samples/spring-xml/src/main/webapp/WEB-INF/applicationContext.xml#L101-L104

On Sat, Jul 8, 2017 at 11:00 AM, Yu Wei <[email protected]> wrote:

> Hi Brian,
>
> I used @RequiresAuthentication in java source code.
>
>
> From shiro document I found content as below,
>
> *This requires Shiro’s Spring AOP integration to scan for the appropriate
> annotated classes and perform security logic as necessary.*
>
>
> But I don't know how to enable "shiro's spring AOP integration". Is there
> any procedure about this?
>
>
> Thanks,
>
> Jared, (韦煜)
> Software developer
> Interested in open source software, big data, Linux
> ------------------------------
> *From:* Brian Demers <[email protected]>
> *Sent:* Wednesday, July 5, 2017 11:22:01 PM
> *To:* [email protected]
> *Subject:* Re: One question about shiro annotations with spring
>
> What do your annotations look like ?
>
> On Tue, Jun 27, 2017 at 3:33 AM, Yu Wei <[email protected]> wrote:
>
>> Hi guys,
>>
>> Should shiro annotations work with spring controller or spring services?
>>
>> When I configured filters in applicationContext.xml as below, everything
>> works well.
>>
>> <property name="filters">
>>             <util:map>
>>                 <entry key="authc">
>>                     <bean class="org.apache.shiro.web.fi
>> lter.authc.PassThruAuthenticationFilter"/>
>>                 </entry>
>>             </util:map>
>>         </property>
>>         <property name="filterChainDefinitions">
>>             <value>
>>                 /school/** = authc
>>                 /user/** = authc, roles[888888]
>>                 /role/** = authc, roles[888888]
>>                 /permission/** = authc, roles[888888]
>>                 /** = anon
>>             </value>
>>         </property>
>>
>>
>> However, when I use the annotations in java code, it doesn't work.
>>
>>
>> Do I missed anything? Any advice?
>>
>>
>>
>> Thanks,
>>
>> Jared, (韦煜)
>> Software developer
>> Interested in open source software, big data, Linux
>>
>
>

Reply via email to