GeeCON Prague 2014*
The moose likes JSP and the fly likes Confusion between the use of JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Confusion between the use of JSP" Watch "Confusion between the use of JSP" New topic
Author

Confusion between the use of JSP

vineet chauhan
Greenhorn

Joined: Oct 30, 2010
Posts: 1

I read that JSP are used for presentation and servlets for writing business logic . But the jsp are themselves converted into servlets. Then why we are we using jsp if they are converted back into servlets again.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61309
    
  66

The fact that JSPs leverage servlets is an implementation detail. It should in no way affect how they are used.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ram Narayan.M
Ranch Hand

Joined: Jul 11, 2010
Posts: 247

Yes... JSP was brought for Presentation Logic... And writing Business Logic in Servlets is a bad design... Then, that business logic cannot be re-used. Servlets makes the decision of redirection to other pages based on the condition.

JSP is basically a Servlet which has the life-cycle of initialization, servicing the request and destroyed...


SCJP 6 [SCJP - Old is Gold]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Confusion between the use of JSP