?
Solved

compiling servlet

Posted on 2014-03-26
1
Medium Priority
?
377 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 2000 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

Independent Software Vendors: 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

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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

801 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