• Post Reply Bookmark Topic Watch Topic
  • New Topic

servlet compilation  RSS feed

 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
given below is a servlet program :



compiling it gives the error below :


is the program wrong or is there a different way to compile servlet ?
 
kiran mathew
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check your classpath. The classes mentioned are not on your classpath.
 
Nalini Gupta
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add servlet-api.jar to the classpath.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nalini Gupta wrote:Add servlet-api.jar to the classpath.

You need to be more specific and less misleading. The filename namely differs per application server implementation. The servlet-api.jar only applies to Apache Tomcat (or clones). It also differs per application server implementation if you just need one or more JAR files.

More correct answer is: "You need to add the JSP/Servlet API classes of the application server implementation to the classpath.".
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!