This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
Author

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.

thanks.
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how is this done in a real time project
 
Similar Threads
Need a real struts 1 project. Not only Login Registration Project
Struts Validations in jsp/servlets
Real World Technologies
when and when Not to use Struts.
Validation using struts