Solved

compiling servlet

Posted on 2014-03-26
1
363 Views
Last Modified: 2014-04-22
Hi,

I was reading as below (http://www.javatpoint.com/steps-to-create-a-servlet-using-tomcat-server)

3)Compile the servlet

For compiling the Servlet, jar file is required to be loaded. Different Servers provide different jar files:
Jar file      Server
1) servlet-api.jar      Apache Tomacat
2) weblogic.jar      Weblogic
3) javaee.jar      Glassfish
4) javaee.jar      JBoss

I wonder why different servers provides different jars for compiling servlet rather than supplying single jar.


Please advise
Any links resources ideas highly appreciated. Thanks in advance
0
Comment
Question by:gudii9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 36

Accepted Solution

by:
mccarl earned 500 total points
ID: 39957745
While they are different JAR's with different names, the core servlet classes/interfaces (eg. javax.servlet.Servlet, javax.servlet.http.HttpServletRequest, etc) that you use in your code would all be defined in exactly the same way within those different JAR's. They might have extra classes in them that are specific to the different servers, but that wouldn't affect how your code is compiled.

Also, when compiling code, nothing from any of those JAR's that you compile against gets "included" into your compiled code. They are just required to get the definitions of those standard Servlet classes/interfaces. So theoretically, you could, for example, compile your servlet code against the Tomcat servlet-api.jar but then still deploy and run your code on one of those other servers.
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question