This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Servlet involving package does not work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Servlet involving package does not work" Watch "Servlet involving package does not work" New topic
Author

Servlet involving package does not work

deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 165
Hi ,

I am trying example of Head First Servlet and Jsp


the code is


and second code is for servlet



and third code for jsp is




When i am compiling the servlet code which is second code its showing me an error"PACKAGE FOO DOES NOT EXIST"


Can anyome help me in this
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19747
    
  10

deepak carter wrote:When i am compiling the servlet code which is second code its showing me an error"PACKAGE FOO DOES NOT EXIST"


Yeah, that would be because you didn't import the package. Servlets are written in Java and follow all the rules of Java programming.
deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 165
sorry i pasted the wrong code

the correct code is



and the error remain the same

Thanks in advance
deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 165
The person class is in foo package
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20131
    
  30

Make sure your compile-time class path is set correctly.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 165
ok
deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 165
I tried i above option however its showing same error.Can anyone help in this regard
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19747
    
  10

Rob Spoor wrote:Make sure your compile-time class path is set correctly.


This still applies. What is that "above option" which you say you tried?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet involving package does not work
 
jQuery in Action, 3rd edition