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!
Joined: Oct 08, 2006
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!
Joined: Jan 30, 2009
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