jQuery in Action, 2nd edition*
The moose likes Servlets and the fly likes where to use these things in good programming way Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "where to use these things in good programming way" Watch "where to use these things in good programming way" New topic
Author

where to use these things in good programming way

ajay atthuluri
Greenhorn

Joined: Jul 18, 2011
Posts: 3
i know java upto servlets and jsp, i am having a problem that in which conditions we have to use jsp and in which condition we have to use servlets, and i have to know where to write the jdbc code in good programming case, can any hep mee.......
Ashwin Sridhar
Ranch Hand

Joined: Jul 09, 2011
Posts: 272

Jsps are used for View. It is mainly used for displaying to the client.
Servlets are used for controllers. This contains Business logic.

Ashwin Sridhar
SCJP | SCWCD | OCA
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61105
    
  66

If you are putting Java code in your JSP, you're doing wrong.
If you are creating HTML in a servlet, you're doing it wrong.

Perhaps this article might be helpful.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Consider Paul's rocket mass heater.
 
subject: where to use these things in good programming way