This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Basic question

 
Rajeev Nair
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just configured Tomcat 4.0.3 and was able to get the tomcat up and running. I tried to compile a simple servlet and I ran into compilation problem.
I have put my servlet in
c:\servletdevel\HelloServlet.java
I have set the class path and put in autoexec.bat as
set CLASSPATH=.;c:\servletdevel;c:\tomcat\common\lib\
servlet.jar.
when I tried to compile it is not recognizing the package import javax.servlet.http.*;.
Can anybody let me know is there something i missed out in classpath setting.
Thanks in advance
 
Faraz Masood
Ranch Hand
Posts: 55
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i also got the same problem when i first tried to run my servlet and here is my way of getting out of that
set classpath=c:\tomcat\common\lib\servlet.jar and dont write anything else in that line
i.e. only define single class path
for your servlets to be eligible to run .. you need to put them in tomcat/webapps/examples/web-inf/classes and your html files in tomcat/webapps/ROOT
there are ways to store that files in your own directory by playing with server.xml ... but first to keep things simple you should not try that out
hope this helps
 
Rajeev Nair
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Faraz. I did the same and was able to get the stuff compiled. Let me know how to play around with server.xml.
Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When your servlets get more complicated and need additional libraries, look into the ANT utility to control the compilation. ANT makes it easy to set up classpaths for the compiler without changing your environment variables. Find ANT at:
http://jakarta.apache.org/
Bill
 
Rajeev Nair
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the info Bill
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic