aspose file tools*
The moose likes Beginning Java and the fly likes problem in compiling servlet 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 » Beginning Java
Bookmark "problem in compiling servlet" Watch "problem in compiling servlet" New topic
Author

problem in compiling servlet

Himanshu Daurbi
Greenhorn

Joined: Nov 09, 2011
Posts: 4
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

Joined: Oct 27, 2005
Posts: 19719
    
  20

Compiling Servlets


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem in compiling servlet