aspose file tools*
The moose likes Servlets and the fly likes How to give classpath while executing servlets 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 "How to give classpath while executing servlets" Watch "How to give classpath while executing servlets" New topic
Author

How to give classpath while executing servlets

pavan Kumar
Greenhorn

Joined: Jan 20, 2005
Posts: 6
My Apache Tomcat Server in c:\programfiles
i'm saving my servlet programs in c:\programfiles\Apache Tomcat 4.0\webapps\root\web-inf\classes\xxxx.java.
while compiling i have set the classpath to c:\programfiles\Apache Tomcat 4.0\common\lib\servlet.jar
.....
But,
It is showing some errors .... plz help me ...
My operating System is : Windows 98
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


It is showing some errors

What are the errors? Without you telling us we can only guess...


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489


while compiling i have set the classpath to c:\programfiles\Apache Tomcat 4.0\common\lib\servlet.jar
.....

If the error is that the system is unable to find the classes in servlet.jar, it may be due to the space between Apache Tomcat and 4.0 if that's how it actually is. You could try changing the dir name to
ApacheTomcat4.0 instead of Apache Tomcat 4.0.
Ofcourse as the post above says, psl always give as much details as possible for us to help u, otherwise we can only make guesses, like how I have done here :-)

ram.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

pavan,

Your display name is invalid, and accounts with invalid display names get deleted.

Please see the note from Marilyn here.

We require display names to be two words: your first name, a space, then your last name. Fictitious names are not allowed.

thanks,
Dave.
James Carman
Ranch Hand

Joined: Feb 20, 2001
Posts: 580
In Tomcat, you can figure out a LOT about the classpath by printing out the ClassLoader...

System.out.println( Thread.currentThread().getContextClassLoader() );

Their WebappClassLoader class (I think that's what it's called) overrides toString() and prints out a wealth of information. Hope that helps!


James Carman, President<br />Carman Consulting, Inc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to give classpath while executing servlets