• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Where does the JSP search for classes?  RSS feed

 
Ranch Hand
Posts: 37
Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67259
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All Java classes used in web apps needs to be in a package other than the default.
 
Ranch Hand
Posts: 355
Chrome Java Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it, Thanks alot.....
 
Willie Smits increased rainfall 25% in three years by planting trees. Tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!