
- Forum
- Programming Talk
- Java
- JSP and Servlet
JSP and Servlet
This is a discussion on JSP and Servlet within the Java forums, part of the Programming Talk category; I have started my reading of Java. I want to know the difference between JSP and servlet. Someone give me ...
-
JSP and Servlet
I have started my reading of Java. I want to know the difference between JSP and servlet. Someone give me a idea on this.
-
12-21-2006, 06:55 AM #2
- Join Date
- Aug 2006
- Answers
- 5
JSP's are simply the html pages with some Java code encapsulated in special tags used to generate HTML dynamically. These are mainly used to render HTML using Java.
Servlet's are java classes where the business logic will be kept. These are mainly useful for processing the request.
-
Friend does it mean that they are two seperate containers placed in a single bag of technology.Correct me if I have understood wrongly.
-
JSP is an extension of servlet technology. JSPs help you create web pages easily by integrating the JSP code within..
As stated above servlet is a pure Java class..
What happens behind the scenes is that the JSP is converted to a normal servlet which is then evaluated, with an output as a static HTML
-
servlets are HTML code embedded in java code.
jsp is java code embedded in HTML code.
-
11-02-2007, 12:30 PM #6
- Join Date
- Nov 2007
- Answers
- 7
Differences between servlet and jsp
Servlet is a simple java class that is loaded dynamically and run in a special container called the Servlet Engine / container
Jsp is a simple language which helps to seperate the request processing and business logic from the presentation. JSP is actually compiled to servlets
People prefer JSP because Servlets
- require detailed java programming knowledge
- changing the look and feel of the page requires servlet code to be updated and recompiled. .. its not required in JSP . compiled automatically by the container which checks for the time stamp of the class in the container when every request arrives.
- addressing JSP pages is simpler compared to servlets.
- pages are HTML like - has greater compatibility with web dev tools.
-
hi
-->hi JSP is mainly intended for Developers who doesnt require any JAVA knowledge and just they can use Markups /Tags just like using HTML .
Servlets are programs wirtten in Java language .
JSP page when compiled , it coverts into Servlet ofcourse .The JSP container(Runtime environment for JSP) takes care of this conversion .
-->JSP is best choice for View Design
and servlets are best choice for acting as controller .
-
11-06-2007, 03:21 AM #8
- Join Date
- Nov 2007
- Answers
- 1
Hi i am salman : if u want to code in java if code requires lot of processing then u should use servlets.If code requires user interface then u should use JSP.note that u can write lot of processing and gui in servlets alone but JSP is good for gui based applications .Eventually every JSP at end of the day will become servlet.
The other difference is that Servlet is nothing but HTML /xml code embedded in java where as JSP is java code embedded in html/xml.
for other quries u cant contact me on cell my number is 9989906865
-
Sponsored Ads

Reply With Quote






