File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Are classes shipped automatically? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Are classes shipped automatically?" Watch "Are classes shipped automatically?" New topic
Author

Are classes shipped automatically?

Sahil Reddy
Ranch Hand

Joined: Jan 24, 2011
Posts: 145
I am writing web application in my "development Environment " where i am writing classes .
Classes are using other SDK classes such as from java.io package and from the javax.servlet package.


When i copy these classes into Server , which is my localhost , how come container (TOMCAT) knows about the SDK classes i am importing and using into my Servlet class. I have not configuered TOMCAT to use and CLASSPATH
and all that jazz...

Thanks and Regards
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Hi Sahil,

The basic Java runtime classes are by default available with the Java runtime (rt.jar). However servlet.jar has to be typically available to any web/app server. It is still working fine because Tomcat has got the servlet.jar in its own classpath which is NOT the exact CLASSPATH of your system.

Remember Tomcat is the RI (Reference Implementation) of Servlet/JSP and it is written in Java!

Hope this helps!


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Sahil Reddy
Ranch Hand

Joined: Jan 24, 2011
Posts: 145
Thanks Raghvan

But i need to ask more

1. If i ship jar file to certain machine having only JAVA. Will it run ?? I mean that machine do not have JAVA SDK .
2. What is RI (Reference Implementation) of Servlet/JSP means ??

Thanks and Regards
Sahil
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


1. If i ship jar file to certain machine having only JAVA. Will it run ?? I mean that machine do not have JAVA SDK .

No. Servlet containers require a JDK. If your Jar were a simple Java application rather than a web application then the machine would need a JRE rather than a JDK.


2. What is RI (Reference Implementation) of Servlet/JSP means ??

See this.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Sahil Reddy
Ranch Hand

Joined: Jan 24, 2011
Posts: 145
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Are classes shipped automatically?