Professional Documents
Culture Documents
Removal of Bean File.
Removal of Bean File.
==========================================================
for java based configuration : we can have @component annotation used on the class
for which we need the bean.
@Configuration
@ComponentScan(basePackages = "com.springcore.javaconfig")
public class JavaConfig{}
-----------------------------------------------------------------------------------
-------
in main class
===========
===============================================================================
changes we made on java.config file.
@Bean(name = {"student","temp","con"})
public Student getStudent(){
Student student new Student(getSamosa());
return student;
}
we can get the bean using above these three bean name : ie. "student","temp","con".
==================================================================================