This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

jsp / servlet / dao / javabeans  RSS feed

 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i have a little local web site with jsp /servlet, i created a bean...... and a dao... what is the best way to use the dao?
in the servet take the jsp parameter, populate the bean and send the bean to dao?

thanks
 
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this kind of thing is typical

The POJO (Plain Old Java Object) is there to move "business logic" out of the servlet and JSP.

Some interesting guidelines: servlet is all Java, uses request & response, no HTML. JSP is all HTML & tags, no Java. POJO is all Java, no HTML, no HTTP* imports.

Editing: I just spotted that you were talking about a bean to hold the parameters that came in on the request. That's perfectly cool, too. I made mine hold the results we got back from the database on a query so we could have several beans involved in this thing.

Does that makes sense?
[ September 05, 2006: Message edited by: Stan James ]
 
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the JDBC forum.
 
mark smith
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank, you help me a lot with your schema
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!