I am developing a web application with EclipseIDE and I am using the Struts2 and Spring3 frameworks.
I am trying to configure the web application acces to my MySQL database.
I am inexperienced with the configuration of these frameworks so I would like someone to give me a help, I'm sure it is not very complicate but I can't find what I am doing wrong.
I have configured the web.xml with the listeners ContextLoaderListener and RequestContextListener and also set the contextConfigLocation (applicationContext.xml).
In the applicationContext.xml:
- I have set the dataSource bean (driverClassName, url, username and password).
- Defined one applicationDAO bean class (it extends SimpleJdbcDaoSupport) with a property that references the dataSource bean.
- And another bean that represents the main action with a property that references the applicationDAO bean.
In the applicationDAO implementation I have implement some methods that acces the MySQL database, but I have not defined any dataSource object and either any dataSource settler because I'm pretty sure that it inherits the dataSource settler method from SimpleJdbcDaoSupport (I am extending this class).
In the main action I have defined an object that represents the applicationDAO and also its settler.
The problem is that when I debug the application, in the point of the main action that I have to use the applicationDAO object methods, it is null.
I don't know what I am missing to configure to be able to use the applicationDAO methods from the main action. I would be very very grateful to get some help.
Thank you very much,