Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

problem in compiling servlet  RSS feed

 
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..........









 
Sheriff
Posts: 21610
101
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Compiling Servlets
 
I AM MIGHTY! Especially when I hold this tiny ad:
java tutor first lesson for free
https://coderanch.com/t/702613/java-tutor-lesson-free
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!