Servlet error ...package Javax.servlet does not exist

C

cormacdebarra

Hi,
I'm writing a simple servlet .. heres the code:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;


public class BeerSelect extends HttpServlet
{

public void doPost(HttpServletRequest request,HttpServletResponse
response)throws IOException, ServletException
{

response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("Beer Selection Advice<br>");
String c = request.getParameter("color");
out.println("<br>Got beer color " + c);
}
}

but i get the packkage does not exist error. I'm using Tomcat 6.0 and
the servlet-api.jar is in the directory :
C:\Program
Files\netbeans-5.0\enterprise2\jakarta-tomcat-5.5.9\common\lib

I've set the CLASSPATH to include this , this is my classpath:

.......C:\jdk1.5.0_09\bin;C:\Program
Files\netbeans-5.0\enterprise2\jakarta-tomcat-5.5.9\common\lib;

Anyone know what the problem is: ( by the way i'm using command prompt
to compile it)

Thanks
 
M

Manish Pandit

I've set the CLASSPATH to include this , this is my classpath:

......C:\jdk1.5.0_09\bin;C:\Program
Files\netbeans-5.0\enterprise2\jakarta-tomcat-5.5.9\common\lib;

You need to qualify the jar file (include the jar file name) in the
classpath. Jars/Zips do not get included in the classpath
automatically, you need to provide the full name.

-cheers,
Manish
 
C

cormacdebarra

Manish said:
You need to qualify the jar file (include the jar file name) in the
classpath. Jars/Zips do not get included in the classpath
automatically, you need to provide the full name.

-cheers,
Manish


My classpath now looks like this:
C:\Program
Files\netbeans-5.0\enterprise2\jakarta-tomcat-5.5.9\common\lib\servlet-api.jar;

but it still gives the same errors

Any ideas
thanks
 
S

Simon Brooke

in message <[email protected]>,
My classpath now looks like this:
C:\Program
Files\netbeans-5.0\enterprise2\jakarta-tomcat-5.5.9\common\lib\servlet-api.jar;

but it still gives the same errors

Is that where the servlet-api.jar actually is on your system? Is it called
exactly that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top