File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes how is this done in a real time project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how is this done in a real time project" Watch "how is this done in a real time project" New topic

how is this done in a real time project

shah rah
Ranch Hand

Joined: Jan 04, 2007
Posts: 124
I am a newbie programmer and I am trying to learn struts by building small applications. I have created a form to accept username and passowrd. I chek the value entered by user against database. I am using hibernate for this. I have all my calls done inside execute method. I feel this may not be the way it is done in real projects. Am I right? if yes, pls guide me about the classes I need to build to totally separate my data access logic from my struts action code.

Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
All the Struts projects that I have worked on have used an EJB tier to implement the business logic. These days Spring seems to be more in favor than EJB (though EJB has it strengths and EJB 3.0 is supposed to be pretty slick). Depending on the requirements of your project you may want to look into EJB or Spring. In any case it probably makes sense to move out logic like validating login information out of your Action class and into a reusable class that could be access from multiple actions.

- Brent
I agree. Here's the link:
subject: how is this done in a real time project
jQuery in Action, 3rd edition