BeerExpert be = new BeerExpert(); List result = be.getBrands(c); Iterator it = result.iterator(); while (it.hasNext()) {
out.print("<br> try:" + it.next());
}
} } while compling this error message displayed as
C:\Java Prog\Servlet\MyProject\beerV1\src\com\example\web\BeerSelect.java:4: package com.example.model does not exist import com.example.model.*; ^ C:\Java Prog\Servlet\MyProject\beerV1\src\com\example\web\BeerSelect.java:23: cannot resolve symbol symbol : class BeerExpert location: class com.example.web.BeerSelect BeerExpert be = new BeerExpert(); ^ C:\Java Prog\Servlet\MyProject\beerV1\src\com\example\web\BeerSelect.java:23: cannot resolve symbol symbol : class BeerExpert location: class com.example.web.BeerSelect BeerExpert be = new BeerExpert(); ^ 3 errors
Tool completed with exit code 1
And here is "BeerExpert" file
package com.example.model;
import java.util.*;
public class BeerExpert { public List getBrands(String color) { List brands = new ArrayList();
We also would appreciate it if you would list the source of where this code came from. Aside from copywrite issues, it's just plain polite. Especially since many of those authors hang out here.
I'm pretty sure this code came from the "Head First" book, yes?
Never ascribe to malice that which can be adequately explained by stupidity.
Joanne Neal
Rancher
Joined: Aug 05, 2005
Posts: 3011
9
posted
0
Is the 'C:\Java Prog\Servlet\MyProject\beerV1\src' directory in your classpath ?
divya sharma
Ranch Hand
Joined: Jan 25, 2007
Posts: 87
posted
0
thanks for you reply...
Well Yes this is a code from HEAD First Servlet.
Well That's the path where the "BeerExpert.java" saved