shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Friedman (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SHIRO-352) Shiro annotations with @Component and getBean(Type)
Date Tue, 27 Mar 2012 15:00:25 GMT

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

Matt Friedman commented on SHIRO-352:
-------------------------------------

Very helpful Bryan. Many thanks. Cheers, Matt
                
> Shiro annotations with @Component and getBean(Type)
> ---------------------------------------------------
>
>                 Key: SHIRO-352
>                 URL: https://issues.apache.org/jira/browse/SHIRO-352
>             Project: Shiro
>          Issue Type: Bug
>          Components: Integration: Spring
>    Affects Versions: 1.2.0
>         Environment: Linux, Spring, Java
>            Reporter: Matt Friedman
>
> I have a bean where I'd like to annotate one of the methods with the @RequiresAuthentication
annotation.
> When using the @RequiresAuthentication annotation and calling applicationContext.getBean(Class<?>)
spring does not find my bean. Commenting out @RequiresAuthentication allows spring to find
the bean. 
> Using the string name of the bean instead of the type (i.e. applicationContext.getBean(String))
does work. 
> // this causes spring to be unable to find the bean when using @RequiresAuthentication

> Class<? extends Processor> processorType = command.getProcessorType();
> Processor processor = applicationContext.getBean(processorType);
> // However this works:
> Processor processor = applicationContext.getBean(processorStringName);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message