Diferences between JSP and Servlets

Discussions

Web tier: servlets, JSP, Web frameworks: Diferences between JSP and Servlets

  1. Diferences between JSP and Servlets (5 messages)

    Hi!

    What are the diferences between JSP and Servlets?

    I know that it is a nonsense for most of you, but I would be extremely obliged if you could answer.

    TIA.

    Threaded Messages (5)

  2. Diferences between JSP and Servlets[ Go to top ]

    it may seems that technically they are 'similar' since JSP are eventually compiled to servlet classes.

    However, they are really different. if u are familiar with MVC pattern, u can think of JSP as the View, and Servlet as the Controller.

    HTH.

    alex


  3. JSP IS FINALLY COMPILED INTO SERVLETS

    BUT THERE ARE SOME ADVANTAGES

    1. REUSABILITY
    2. IMPLICIT OBJECTS
    3. EASY TO USE TAGS
    4.SEPERATION OF DYNAMIC CONTENT FROM PRESENTATION(LOOK AND FEEL)
    . USAGE OF HTML INSIDE JAVA( XML ALSO)
      BUT SERVLETS JAVA INSIDE HTML
    YOU CAN DO ALMOST ALL THE THINGS WITH JSP
    BUT SUN DOCUMENTS RECOMMEND SERVLETS FOR USE AS
    CONTROLLER COMPONENTS FOR SERVICES LIKE
    AUTHENTICATION, DATABASE VALIDATION ETC
  4. I read some design papers recommend use Servlet as controller in MVC pattern. From my experience of doing a few B2B projects, I find that use JSP as controller is easier for writing, maintaining and modifing the code.

    Fun
  5. Diferences between JSP and Servlets[ Go to top ]

    The major difference between a JSP and a servlet

    Jsp is developed for high production demand and fexibility
    so that an jsp developer need not know much about JAVA(hence Economical).

    Whereas Servlet developer should be strong in Java. Internally JSP is converted into a servlet.

  6. Diferences between JSP and Servlets[ Go to top ]

    Hi,
    The basic advantage is the separation of business logic layer from the presentation layer. otherwise you can do almost anything a jsp does by using a servlet.

    this helps in productivity.

    you should handle the business logic in servlet and presentation in Jsp. and they should interact between themselves.