Solved

compiling servlet

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
IT Company 5 69
strCopies  challenge 17 73
backtracking recursion  code 19 40
eclipse java  build path 6 20
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now