1. Compile the model this way from src folder: javac -d ../classes com/example/model/BeerExpert.java This will create a folder called classes in the parent directory of src (..) and put com.example.model.BeerSelect class file in that package structure in the created classes directory.
2. Compile the servlet this way from src folder: javac -classpath /Tomcat_5.5/common/lib/servlet-api.jar -classpath ../classes -d ../classes com/example/web/BeerSelect.java
3. Copy the contents of the classes folder to <your_application_in_server>/WEB-INF/classes folder.
4. When you register this servlet in web.xml, do not forget the full qualified class name (including the package structure)
i did as you said from step 1 and 2. but step 3 when i compile using exactly what you said, it gave me error like "package javax.servlet does not exist" and the rest of javax.servlet and javax.servlet.http also no exist.
gosh, once this problem not fix, i hardly to continue to chapter 5 of HFSJ.
Diploma in Computer Studies
Formula 1 app by Maxis (Playbook)
I have the same problem as Nicky, I have the system CLASSPATH set to point servlet-api.jar so when I compile I just put javac -d src/com/example/web/BeerSelect.java
How can I introduce the word ;classes; in the statement so I don't have to put the whole path everytime? I'm trying different statements but I still get 'package com.example.model does not exist'
I also tried: javac -classpath servlet-api.jar;classes; -d classes src/com/example/web/BeerSelect.java but then it doesn't find the javax packages too.