• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet involving package does not work

 
deepak carter
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20748
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry i pasted the wrong code

the correct code is



and the error remain the same

Thanks in advance
 
deepak carter
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The person class is in foo package
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure your compile-time class path is set correctly.
 
deepak carter
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok
 
deepak carter
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried i above option however its showing same error.Can anyone help in this regard
 
Paul Clapham
Sheriff
Pie
Posts: 20748
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic