This is my eventAction ActionSupport Class
public class EventAction extends ActionSupport {
protected EventService eventService;
protected String redirectUrl;
public String getRedirectUrl() {
return redirectUrl;
}
public void setRedirectUrl(String redirectUrl) {
this.redirectUrl = redirectUrl;
}
public void setEventService(EventService services) {
this.eventService = services;
}
}
And here is a fragment from my applicationContext.xml
<bean id ="eventService" class ="services.EventService" scope ="singleton">
<property name = "sessionFactory" ref = "sessionFactory"/>
</bean>
The code is working fine except for when I change the id inside the declartion.
My question why does spring <bean id ="eventService">
id has to be matched with eventService instance variable inside EventAction support class? isn't id
is just making an identifier for the bean that is going to be created? why should the id inside the bean tag should be the same inside my EventAction, where the EventAction class is not even being mentioned in the configruation?