1

Possible Duplicates:
What is the difference between JSF, Servlet and JSP?
JSP Servlet and Web Programming

When it comes to the open-source Java Platform, Enterprise Edition (Java EE) application server, how would you characterize the difference between:

  • JSP
  • Servlet

While both are able to generate dynamic Web content, I am unsure about how they differ and/or how on pertain to the other.

Community
  • 1
  • 1
rakesh shetty
  • 21
  • 1
  • 2
  • -1 - poorly phrased question. I know that English is not the OP's first language, but surely he could have made a better effort than that! – Stephen C Jul 20 '10 at 05:58
  • Couldn't you just edit it to fix it? I would if I had the rep... – Catchwa Jul 20 '10 at 06:38
  • @Catchwa - it is the OP's responsibility to do that. Honestly, if he had made >>>some<<< effort, I wouldn't have down-voted his question. – Stephen C Jul 20 '10 at 07:07
  • I hope the question may be a bit clearer, although a/ I am not a native English writer ;) b/ I made the edit mainly to use the word "pertain". Such an odd word. – VonC Jul 20 '10 at 07:08
  • 2
    @stephen either 1) edit his question to help him or 2) move on. No need to -1 someone struggling to cross a language barrier. –  Jul 20 '10 at 13:25

2 Answers2

4

JSP is Java Servlet Pages and usually used in rendering HTML/XHTML pages. To me, it's a PHP clone. JSPes will be translated and compiled to Servlet classes eventually.

Servlet on the other hand is a class conforming to the Servlet API, to process HTTP requests, such as GET, POST, etc.

You can read more about Servlet API and its documentation here.

yclian
  • 1,490
  • 14
  • 22
0

I suggest you to read this DevX article discussing Servlet and JSP. If you want to know still some more... Go for this and this Wiki

Venkat
  • 2,604
  • 6
  • 26
  • 36
  • A servlet is a java class where we could generate HTML code, while JSP is a sort of HTML page where we can write JAVA code. so JSP come handful when we wanna show the views of the application while the purpose of Servlets is handling the HTTP requests / Logic of the app, it plays the role of the controller of the app. – Saad Joudi Mar 14 '21 at 17:41