• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Beer Question from Head First  RSS feed

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Im attempting to compile the beer question from the Head First book
but i keep getting this error

U:\MyProjects\beerV1>javac -classpath /apache-tomcat-6.0/lib/servlet-api.jar;classes:. -d classes src/com/example/web/BeerSelect2.java
src\com\example\web\BeerSelect2.java:4: package com.example.model does not exist

import com.example.model.*;
^
src\com\example\web\BeerSelect2.java:21: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect2
BeerExpert be = new BeerExpert();
^
src\com\example\web\BeerSelect2.java:21: cannot find symbol
symbol : class BeerExpert
location: class com.example.web.BeerSelect2
BeerExpert be = new BeerExpert();
^
3 errors

==================================================================

This is my BeerSelect2 java file and I do have the BeerExpert class file in
U:\MyProjects\beerV1\classes\com\example\model.

package com.example.web;
import com.example.model.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

public class BeerSelect2 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");

BeerExpert be = new BeerExpert();
List result = be.getBrands(c);
Iterator it = result.iterator();

while (it.hasNext()) {
out.print("<br>try: " + it.next());

}
}
}

I cant figure out what I am doing wrong to compile it.
Any help would be great.
Thanks
 
permaculture is giving a gift to your future self. After reading this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!