permaculture playing cards*
The moose likes JSP and the fly likes JSP page not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP page not working" Watch "JSP page not working" New topic

JSP page not working

deepak carter
Ranch Hand

Joined: Feb 19, 2011
Posts: 165

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


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

Joined: Apr 25, 2010
Posts: 507

All classes should be inside a package. Tomcat does not pick up some classes which are there in default package.

Regards, Prasad
SCJP 5 (93%)
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60055

As of Java 1.4 the default package cannot be imported. You should always package Java classes.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: JSP page not working
Similar Threads
Where does the JSP search for classes?
how to run jsp in tomcat
Error accessing jsp page
Problem in accessing an attribute through action elements
Help for a simple jSP program