Can't use annotation injection in spring

View: New views
1 Messages — Rating Filter:   Alert me  

Can't use annotation injection in spring

by tomLee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi experts,

I have such code in the below:
@Service
public class LoginAction extends SimpleFormController {
    private String fail_view;
    private String success_view;
    @Resource(name = "userSerivceTX")
    private UserService service;
..

<bean id="userSerivceTX"  class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
                <property name="transactionManager">
                        <ref bean="transactionManager" />
...

<bean id="LoginAction" class="net.xiaxin.action.LoginAction">
                <property name="commandClass">
....


<context:annotation-config/>



I want to use annotation injection.but I failed,the property of  LoginAction :service is null when LoginAction is invoked.

Thanks.