Hi
When I try to compile CoffeeSelect from pg 85 of HF JSP,I am getting the following error messages.
--------------------------------------------------------------------------
C:\MyProject\coffeeV1>javac -classpath /tomcat/common/lib/servlet-api.jar:classes:. -d classes src/com/example/web/CoffeeSelect.java
src/com/example/web/CoffeeSelect.java:3:
package com.example.model does not exist import com.example.model.*;
^
src/com/example/web/CoffeeSelect.java:4:
package javax.servlet does not exist import javax.servlet.*;
^
src/com/example/web/CoffeeSelect.java:5: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
src/com/example/web/CoffeeSelect.java:9: cannot resolve symbol
symbol : class HttpServlet
location: class com.example.web.CoffeeSelect
public class CoffeeSelect extends HttpServlet {
^
src/com/example/web/CoffeeSelect.java:11: cannot resolve symbol
symbol : class HttpServletRequest
location: class com.example.web.CoffeeSelect
public void doPost(HttpServletRequest request, HttpServletResponse respo
nse)
^
src/com/example/web/CoffeeSelect.java:11: cannot resolve symbol
symbol : class HttpServletResponse
location: class com.example.web.CoffeeSelect
public void doPost(HttpServletRequest request, HttpServletResponse respo
nse)
^
src/com/example/web/CoffeeSelect.java:12: cannot resolve symbol
symbol : class ServletException
location: class com.example.web.CoffeeSelect
throws IOException, ServletException {
^
src/com/example/web/CoffeeSelect.java:20: cannot resolve symbol
symbol : class CoffeeExpert
location: class com.example.web.CoffeeSelect
CoffeeExpert be=new CoffeeExpert();
^
src/com/example/web/CoffeeSelect.java:20: cannot resolve symbol
symbol : class CoffeeExpert
location: class com.example.web.CoffeeSelect
CoffeeExpert be=new CoffeeExpert();
^
9 errors
------------------------------------------------------------------------
Please, closely take note of the two errors that are highlighted.
Firstly, it cannot find my model package in which my CoffeeExpert sits.
Secondly, it cannot locate my javax.servlet.
I have installed
Tomcat 5.xxx it has the servlet-api jar file. The model package has been setup and coded according to the book. There is no problem with the code I have cross checked several times.
I fail to understand the cause of the above two problems.