File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where in WEB- INF will I put my hibernate DAOs?

 
David Silkin
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David Silkin
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 528
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic