I'm displaying text and xml on a webpage through a servlet. The servlet just loads the HTML/XML to the page on load through calls in the getPost() method. Now that I have that working the way I want it to my next step is to replace the static display text with calls to the database so that it can display information dynamically. My question is:
What is the best way to do this. I'm using JPA and entities for persistence but I have a choice of making direct calls to the persisted items or going through an Data/Entity Access Object which I have created. I followed a tutorial that used EAO's and Entities with EJBs as a way of teaching best practices. I don't see the value in doing this yet, however. It seems overly complicated to go through 3 classes when I could just access the data directly.
So is this the preferred method? or should servlets access data directly or through EAO's?
Thanks