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
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;
}
...