• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in compiling servlet

 
Himanshu Daurbi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

I'm getting error when I'm compiling my servlet as......
Note: I'm using apache tomcat 5.5 and I have already set java_home,jre_home,and jdk path by environment variable
C:\Users\him\applications\Tomcat 5.5\webapps\BeerV1>javac classpath "Users\him\applications\Tomcat 5.5\common\lib\servlet-api.jar":. -d WEB-INF\classes\com\example\web\BeerSelect.java

src\com\example\web\BeerSelect.java:3: package javax.servlet does not exist
import javax.servlet.*;
^
src\com\example\web\BeerSelect.java:4: package javax.servlet.http does not exist

import javax.servlet.http.*;
^
src\com\example\web\BeerSelect.java:6: cannot find symbol
symbol: class HttpServlet
public class BeerSelect extends HttpServlet {
^
src\com\example\web\BeerSelect.java:7: cannot find symbol
symbol : class HttpServletRequest
location: class com.example.web.BeerSelect
public void doPost(HttpServletRequest request,HttpServletResponse respon
se) throws IOException,ServletException {
^
src\com\example\web\BeerSelect.java:7: cannot find symbol
symbol : class HttpServletResponse
location: class com.example.web.BeerSelect
public void doPost(HttpServletRequest request,HttpServletResponse respon
se) throws IOException,ServletException {
^
src\com\example\web\BeerSelect.java:7: cannot find symbol
symbol : class ServletException
location: class com.example.web.BeerSelect
public void doPost(HttpServletRequest request,HttpServletResponse respon
se) throws IOException,ServletException {

^
src\com\example\web\BeerSelect.java:10: cannot find symbol
symbol : variable out
location: class com.example.web.BeerSelect
out.println("Beer selection advice<br>");
^
src\com\example\web\BeerSelect.java:11: cannot find symbol
symbol : variable requset
location: class com.example.web.BeerSelect
String c = requset.getParameter("color");
^
src\com\example\web\BeerSelect.java:12: cannot find symbol
symbol : variable out
location: class com.example.web.BeerSelect
out.println("got beer color: "+c);

Plaease tell me the raeson of error


Thanks in advance..........









 
Rob Spoor
Sheriff
Pie
Posts: 20546
56
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Compiling Servlets
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic