File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Make it so: Java DB Connections & Transactions this week in the JDBC 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: 659

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

Joined: Jan 10, 2002
Posts: 63548

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

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: JSP page not working
It's not a secret anymore!