ways to inject a object of a class in spring controller?
I need to inject a object of a java class in spring controller through
applicaionContext.xml. My controller will be ,
@Controller
public class SpringController{
private MyClass obj;
}
I know I can do it with @Autowired. Is this really good to create a object
for a ontroller through applicaionContext.xml ? Also can I inject a object
using the <property> tag in applicationContect.xml.
Is this really possible ? or please forgive me if it is a stupid question.
I need to know the possible ways for how to inject a object of a class in
Spring controller ?
No comments:
Post a Comment