Wednesday, February 29, 2012

What does Java Servlet Web Server such as Tomcat or Jetty do in a web server?

Hi,



Sorry for my ignorance but I am new to Java and web applications. Can anyone tell me the purpose of Java servlet web server such as Tomcat or Jetty? Is there any other software (free to download and use) that does the same job? Does Java Runtime Environment do the same job?



Thanks in advance for your answers.What does Java Servlet Web Server such as Tomcat or Jetty do in a web server?
Java Runtime Environment (JRE) is the backbone of everything relating to Java.



A Java servlet web server like Tomcat or Jetty is a bunch of programs written in Java and powered by the JRE to act as a web server. In a normal web server like Apache, you create html files that are sent to any browser that requests it. In Tomcat or Jetty, you can use Java to generate an html file before it is sent. These files are not HTML; they are called JSP, but can be used to generate HTML as well as anything else you want to generate and send to the web browser.



JSP and Java Servlets are just like PHP, ASP, CGI, etc.What does Java Servlet Web Server such as Tomcat or Jetty do in a web server?
Apache Tomcat is a web server which supports the Java Servlet technology. You can say that a Java Servlet is like web request handler. It handles some rrequest from a client or user. Then, some data manipulation and processes are done by the servlet and returns a corresponding response.



I believe there are other web servers that supports Java Servlets (I was only able to use Tomcat :D).



Java Runtime Environment is different thing. JRE is a set of libraries and applications that are needed to run Java applications. JRE is like the interpreter for Java. It interprets the codes in your Java classes so that your computer will know what a Java application is trying to achieve.

No comments:

Post a Comment