Read here: https://www.concretepage.com/spring/e...
Spring idref element is used to pass the id of a bean to another bean as string. The idref works same as value attribute but when we use idref then there must be a bean with that id which we pass to idref.