Help get this topic noticed by sharing it on Twitter, Facebook, or email.

I have a problem of working with servlet

I am learning servlets through O'Reilly book. In that example i am getting an error which i am not able to resolve it. The servlet name specified in the book is BeerSelect(i am using CoffeeSelect) in the beginning of 3rd chapter. At first it is compiled well.But once i imported the package: import com.example.model, it says: package com.example.model doesnt exist. Also it says CoffeeExpert ce =new CoffeeExpert(); cannot find symbol. If i compile another java ie CoffeeExpert it compile but it gives warning as: src\com\example\model\ used unchecked or unsafe operations. Recompile with -Xlint:unchecked for details. Will you please help me to resolve this? Expecting your reply.
Thanks in Advance
1 person has
this problem
  • Hi Kalpana,

    The key here is that you don't import packages, you import classes.
    The book actually says

    import com.example.model.*;

    The .* is very important note.

    However, you may want to review the chapter, Java projects require careful attention to file placement. Anything in the com.example.model project must be on the filesystem in that same order
    Head First Servlets and JSP, 2E
    Passing the Sun Certified Web Component Developer Exam
    By Bryan Basham, Kathy Sierra, Bert Bates
    ISBN 13: 9780596516680

    Mace Bergmann --
    O'Reilly Media Inc.--
  • (some HTML allowed)
    How does this make you feel?
    Add Image

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated