• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Head First Servlets & JSP - Chapter 3, servlet version 2

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If someone has read this book or has prior info which might get me back on track, I would really appreciate it.

I am getting a

package com.example.model does not exist

error and yet I have followed the book instruction to a tee (code, directories, etc). I am wondering if the book may be in error since the import statement points to a directory that contains only a java file instead of a class file (as shown below). As instructed by the book, the class file, which the import statement points to, is not in the

src\com\example\model

directory -- rather it is in the

classes\com\examples\model

directory (right where the -d command SHOULD put it).

Below is the directory structure and the servlet code

DIRECTORY STRUCTURE:
beerV1
---src
------com
---------example
------------web
---------------BeerSelect.java

------------model
---------------BeerExpert.java

---classes
------com
---------example
------------web

------------model
---------------BeerExpert.class


SERVLET CODE (as instructed by book):


Thanks in advance for your help.
 
John Freshman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sorry, my post has a typo. The

classes\com\examples\model

should be

classes\com\example\model



The 'example' reference is singular, not plural.
 
John Freshman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I stand corrected:

I was missing the all important ";classes;" in my -classpath statement.

Since the examples in the book are shown using a MAC (which uses Unix, hence forward directory slashes), I assumed the :classes: statement was foreign to Windows and would not work in Windows.

I'll never doubt again
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic