Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • 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
Posts: 21892
36
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
Posts: 20822
68
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
Posts: 21892
36
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?
 
We noticed he had no friends. So we gave him this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!