• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP page not working

 
deepak carter
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on a example in chapter 7 of HEadFirst Servlet and JSp



and



when i am not putting class Counter inside a package foo and commenting the first line which state package foo; and simply putting the class Counter under classes its not working and when i am putting it inside package foo its working


why its happening
 
Prasad Krishnegowda
Ranch Hand
Posts: 667
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All classes should be inside a package. Tomcat does not pick up some classes which are there in default package.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As of Java 1.4 the default package cannot be imported. You should always package Java classes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic