This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hi everyone, this is my first ever post to a coding forum; I must really like this place ... Anyway I have a bunch of classes that use hibernate to do database stuff. I would now like to have servlets referencing these DAOs but I dont how to merge the two so that the servlet can perform db operations, as they are in different directories. I hope this makes sense to someone. Thanks in advance!
David
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
Sorry, it doesn´t make sense to me.
Can´t you just place the DAO classes in the classpath and import and use it in the servlet the usual way?
You don't need to put DAOs in your web.xml. Hibernate doesn't require anything in web.xml in fact. You just need to call your DAO from your servlet and (assuming your DAOs are on your classpath) it will all just work.
Thank you Paul and Bauke, as soon as I read your replies I knew how silly my post looked. I have followed disparate tutorials and sometimes it can be tricky to think outside the scope of one and apply other concepts to it. Thanks for the help, much appreciated!
RaviNada Kiran
Ranch Hand
Joined: Jan 30, 2009
Posts: 528
posted
0
I think that he is not asking to make his enteries of DAO in web.xml file.
You will be having classes folder in the WEB-INF/classes , place all your DAO class files there.
If you want something you never had do something which you had never done