This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 60752

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
Help for a simple jSP program
how to run jsp in tomcat
Error accessing jsp page
Problem in accessing an attribute through action elements
Where does the JSP search for classes?