• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference between servlets and JSP

 
k ramesh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have the doubt that whether servlet and JSP are same.Because both provide dynamic content to clients.
What is the main difference between them?
Thanking you.
KRamesh
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have the doubt that whether servlet and JSP are same.


NO they are NOT.


Because both provide dynamic content to clients.


Even though both is used to generate dynamic content their purpose is different. You got to learn MVC to understand why there is 2 technology for producing dynamic content.


What is the main difference between them?


JSP is translated and compiled to servlets.

I suggest you to buy Head First Servlets and JSP book to have a better understanding of all these.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think of JSP as shorthand for creating servlets geared toward marking up and presenting data in an HTML or other text based format.
They're good enough at doing this that an HTML designer can work with them all day without knowing anything about servlets.

For just about any other task, they're clunky and inappropriate.
As Vishnu mentioned earlier, the MVC pattern allows you to use the right tools for each of the various tasks involved with building a large web app.
 
weiwei tian
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think their difference is that the java code implanted in the html I call its jsp, the html code embed in the java code I call its servlet,of course,the servlet have more ability than the jsp, jsp just the interface.antistatic
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!