Eclipse won't autocomplete bean methods in EL when I use javax.annotation.ManagedBean

前端 未结 1 1198
醉酒成梦
醉酒成梦 2021-01-24 09:06

I created an application using JSF and Spring and I used the annotations @repository, @service @component and @autowired but when I am coding the Facelet file the beans cannot s

相关标签:
1条回答
  • 2021-01-24 09:58

    I solve the problem, and the problem is that I imported a wrong annotation in the managed bean the wrong import:

    import javax.annotation.ManagedBean;
    

    the right import:

    import javax.faces.bean.ManagedBean;
    

    so the result :

    package com.tds.erp.managedController;
    
    import java.util.ArrayList;
    import java.util.List;
    
    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.SessionScoped;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Component;
    
    import com.tds.erp.model.Employee;
    import com.tds.erp.services.IEmployeeService;
    
    
    @Component
    @ManagedBean
    @SessionScoped
    public class EmployeeMB {
    
    
    
        @Autowired
        private IEmployeeService EmployeService;
    
        private Employee employee= new Employee();
        private List<Employee> employeeList= new ArrayList<Employee>();
        private Employee selectedEmployee=new Employee();
        private boolean headerButtonsDisabled=true;
    
        public void setEmployeService(IEmployeeService employeService) {
            EmployeService = employeService;
        }
    
        public IEmployeeService getEmployeService() {
            return EmployeService;
        }
        ...
    
    0 讨论(0)
提交回复
热议问题