Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

DAO layer in struts-2

 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In struts-2, how to use DAO layer which communicates with DB. I don't know if DAO layer comes, then what is the function of Model. Now, in my application, I've bean with setters and getters, Model which is responsible for communicating with DB and retrieving DB. Action classes which validates client side input. Can anybody give me a proper structure of struts-2 with DAO layer?

Thanks:
Ramakrishna K.C
 
Bartender
Posts: 9615
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The major components of Struts 2 do not exactly map to the MVC pattern. This article has a typical MVC overlay of Struts. As far as Struts is concerned, the controller is the dispatcher and interceptors. For a non-trivial Struts application, I would maintain there will be a fair amount of controller logic in the Action and the Model is usually pushed into a JavaBean. The Action then uses the DAO to obtain the appropriate Model instance for what the View has requested..
 
That's my roommate. He's kinda weird, but he always pays his half of the rent. And he gave me this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic