Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between JSP and Servlets

 
vibhor mathur
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everybody
What is the difference between servlets and JSP?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you searched the web for the answers to this?

In a nutshell, servlets are written in Java. JSPs are plain-text files that get converted into equivalent servlets.
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a link that might help

Search

A related article

Article
 
Vamsi Mohan
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[copied material removed -- do not copy material from other sites without references]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vamsi Mohan wrote:A Java Server Page is a completely web based content. JSP pages contain a mixture of HTML, Java scripts (not to be confused with JavaScript) ...

Although the use of Java scriptlets in JSP pages is considered a poor practice at this juncture, replaced by the JSTL and EL.

And, a JSP can certainly contain JavaScript. Think of a JSP as a template for an HTML page.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Vamsi: when quoting other sources it's nice to provide a reference.
 
Prashant Langade
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlet's are java programs which gets executed on server and JSP's are used for showing server response to end user.Thus in short Servlet's are used for request processing while JSP's are used for presentation logic.

Hope this helps you!!!



Prashant
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic