1. #1
    Unregistered

    What is the difference between Java and Servlet?

    hello
    What is the difference between JSP and servlet????





  2. Related:
  3. #2
    navjotsidhupamal
    Join Date
    Jun 2012
    Posts
    953

    Re: What is the difference between Java and Servlet?

    hello friend..!!!

    ->the main differences between java and servlet are:-

    1.Java is standalone application and a servlet class is server side.
    2.Java used main method and servlet used init().
    3.servlet used for make dynamic HTML pages and so on.

    ->A java class may be used "on the server" as you put it.You can write server components that have nothing to do with servlets.The key difference according to me is that Servlet is deployed into a container and its life cycle is managed by that.

    ->a JSP is a servlet that thinks it's a web page.

    ->->Servlets and Java Server Pages are complementary APIs, both provides generating dynamic Web content.

    ->A servlet is a Java class implementing the javax.servlet.Servlet interface that runs within a Web or application server's servlet engine,service client requests forwarded to it through the server.

    ->A Java Server Page is a slightly more complicated .

    ->JSP pages contain a mixture of HTML, Java scripts, JSP elements, and JSP directives.

    -> The elements in a Java Server Page will generally be compiled by the JSP engine into a servlet, but the JSP specification only requires the JSP page execution entity follow the Servlet Protocol.

    ->The advantage of Java Server Pages is that they are document-centric.

    -> Servlets, on the other hand, look and act like programs.

    -> A Java Server Page can contain Java program fragments that instantiate and execute Java classes, but these occur inside an HTML template file and are primarily used to generate dynamic content.

    ->Some of the JSP functionality can be achieved on the client, using JavaScript.

    ->The power of JSP is that it is server-based and provides a framework for Web application development.

    ->Rather than choosing between servlets and Java Server Pages, you will find that most non-trivial applications will want to use a combination of JSP and servlets.

    ->the JSP 1.1 and Servlet 2.2 specifications are based around the concept of the Web application, combining the two APIs into a unified framework.

    thank u!!




  4. #3
    Rudra Pradhan
    Join Date
    Nov 2012
    Posts
    31

    Re: What is the difference between Java and Servlet?

    hello friend,
    ->the main differences between java and servlet are:-

    1.Java is standalone application and a servlet class is server side.
    2.Java used main method and servlet used init().
    3.servlet used for make dynamic HTML pages and so on.

  5. #4
    lakshmi dhana
    Join Date
    May 2012
    Location
    kk
    Posts
    1,299

    Re: What is the difference between Java and Servlet?

    Main difference between Java and Servlet

    1. Java is standalone application and a Servlet class is Server side.
    2. Java used main method and Servlet used init(),service(doGet(),doPost()) and destroy() method for completion the application.
    3. Servlet used for make dynamic HTML pages.and so on..

  6. #5
    punx
    Join Date
    Sep 2011
    Posts
    218

    Thumbs up Re: What is the difference between Java and Servlet?

    >>you cannot compare java and servlet because java is a programming language and servlet is a technology.
    >>servlet is a server side programming with this you can develop web applications(web sites).
    >>this servlet programs can be deployed in web servers like Tomcat.
    >>with this we can develop web servers which take request and give response.
    >>servlet include business and presentation in single java file.


    >>java contains multiple platforms like J2SE,J2EE,J2ME .
    and servlet is a one of component in J2EE.
    >>with java you can develop (1)Desktop or standalone applications(1-tier or 2-tier applications)
    (2)Distributed applications
    (3)Web applications
    and etc..
    Common Thing:
    both are java file which can have .java extension

+ Reply to Thread

Quick Reply Any Question?