wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes jsp / servlet / dao / javabeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "jsp / servlet / dao / javabeans" Watch "jsp / servlet / dao / javabeans" New topic
Author

jsp / servlet / dao / javabeans

mark smith
Ranch Hand

Joined: Apr 05, 2005
Posts: 245
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
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
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 ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Moving to the JDBC forum.
[ September 05, 2006: Message edited by: marc weber ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp / servlet / dao / javabeans
 
Similar Threads
A Design Problem
Pagination logic in jsp
Data Access Object Pattern
SCEA v5 Certified
jsp / servlet / dao / javabeans