aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Where does the JSP search for classes? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Where does the JSP search for classes?" Watch "Where does the JSP search for classes?" New topic
Author

Where does the JSP search for classes?

Matloob Hussain
Ranch Hand

Joined: May 13, 2011
Posts: 37

Hi,
My code does not work when I use Counter.java class without any package. When I use foo package then it works by finding Counter class in directory "WEB-INF/classes/foo/" but when I don't use foo package then I should find Counter class from directory "WEB_INF/classes" but it does not work and one thing more, do we need to use import attribute in page directive when we are not using any package. all java classes in classes directory.

Counter.java class

JSP code


Matloob
OCPJP 1.6
OCPWCD in progress.....
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

All Java classes used in web apps needs to be in a package other than the default.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Faisal Ahmad
Ranch Hand

Joined: Aug 31, 2006
Posts: 355

Thank you guys! I didn't know this before. However, I have a habit of keeping my classes in some package. So, never thought about this. Thanks again!
Matloob Hussain
Ranch Hand

Joined: May 13, 2011
Posts: 37

Got it, Thanks alot.....
 
Don't get me started about those stupid light bulbs.
 
subject: Where does the JSP search for classes?