Exforsys
+ Reply to Thread
Results 1 to 8 of 8

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 ...

  1. #1
    sammy is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    145

    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.


  2. #2
    gpraveen_mca is offline Junior Member Array
    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.


  3. #3
    sammy is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    145
    Friend does it mean that they are two seperate containers placed in a single bag of technology.Correct me if I have understood wrongly.


  4. #4
    adeepak's Avatar
    adeepak is offline Junior Member Array
    Join Date
    Jul 2006
    Location
    Pune
    Answers
    4
    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


  5. #5
    singhsn is offline Junior Member Array
    Join Date
    Sep 2007
    Answers
    3
    servlets are HTML code embedded in java code.
    jsp is java code embedded in HTML code.


  6. #6
    vickyas400 is offline Junior Member Array
    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.


  7. #7
    jyothi423 is offline Junior Member Array
    Join Date
    Jun 2007
    Answers
    6

    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 .


  8. #8
    salmanarafath is offline Junior Member Array
    Join Date
    Nov 2007
    Answers
    1
    Quote Originally Posted by sammy View Post
    I have started my reading of Java. I want to know the difference between JSP and servlet. Someone give me a idea on this.
    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



Latest Article

Network Security Risk Assessment and Measurement

Read More...