Solved

compiling servlet

Posted on 2014-03-26
1
343 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 35

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
servlet example 11 59
jboss wildfly 10.1 10 436
wild fly 8 startup error 2 42
junit as external jar or library 7 39
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

733 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