Solved

compiling servlet

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

776 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