Hello,
my problem looks prety simple,but dont know why its haunting me.
anyways heres my problem.
There is a folder called "BeerV1" which has "src" and "classes" folders.
i have two files as followes...
under the "src" folder:
1. com.example.model.BeerExpert;
2. com.example.web.BeerSelect;
first i compile the BeerExpert class using -d option, like this
c:\practice\projects\BeerV1>javac -d classes src\com\example\model\BeerExpert.java
... it works just fine, producing the .class file in correct package structure under "classes" folder.
BeerSelect class is a
servlet. it has-a BeerExpert. BeerExpert is a "model" class, as in MVC
pattern "model". it returns me an arraylist,nothing special. when i compile the BeerSelect the following is the output...
c:\practice\projects\BeerV1>javac -cp "%CATALINA_HOME%\lib\servlet-api.jar" -d c
lasses src\com\example\web\BeerSelect.java
src\com\example\web\BeerSelect.java:19: cannot find symbol
symbol : class BeerExpert
location: class BeerSelect
BeerExpert be=new BeerExpert();
^
src\com\example\web\BeerSelect.java:19: cannot find symbol
symbol : class BeerExpert
location: class BeerSelect
BeerExpert be=new BeerExpert();
^
2 errors
then i think, ok, its not able to locate the BeerExpert class, so let me specify classes folder in -classpath option and i do this
c:\practice\projects\BeerV1>javac -cp "%CATALINA_HOME%\lib\servlet-api.jar":clas
ses -d classes src\com\example\web\BeerSelect.java
src\com\example\web\BeerSelect.java:4: package javax.servlet does not exist
import javax.servlet.*;
^
src\com\example\web\BeerSelect.java:5: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
src\com\example\web\BeerSelect.java:10: cannot find symbol
symbol: class HttpServlet
public class BeerSelect extends HttpServlet{
^
src\com\example\web\BeerSelect.java:11: cannot find symbol
symbol : class HttpServletRequest
location: class BeerSelect
public void doPost(HttpServletRequest request,HttpServletResponse
^
src\com\example\web\BeerSelect.java:11: cannot find symbol
symbol : class HttpServletResponse
location: class BeerSelect
public void doPost(HttpServletRequest request,HttpServletResponse
^
src\com\example\web\BeerSelect.java:19: cannot find symbol
symbol : class BeerExpert
location: class BeerSelect
BeerExpert be=new BeerExpert();
^
src\com\example\web\BeerSelect.java:19: cannot find symbol
symbol : class BeerExpert
location: class BeerSelect
BeerExpert be=new BeerExpert();
^
7 errors
c:\practice\projects\BeerV1>
--------------
so now it cannot import any of the servlet classes as well. WHAT AM I DOING WRONG???