Do I have to? I didnt place the class in any package. The class Counter.class is in directory classes.
Peter Sin
Ranch Hand
Joined: Jan 13, 2005
Posts: 547
posted
0
Originally posted by vasu dupe:
<html> <body> The page count is: <% out.println(Counter.getCount()); %> </body> </html>
You haven't imported your java class in jsp. Please check how to import class in jsp. Hints : Add one statement. [ March 06, 2006: Message edited by: Peter Sin ]
You cannot import a package-less class. Put the class in a package and then import it.
stu ware
Greenhorn
Joined: Feb 04, 2006
Posts: 15
posted
0
Thanks. I got it.From this I understand that every class we develop should be in a package while using JSPs. Is that true.
Peter Sin
Ranch Hand
Joined: Jan 13, 2005
Posts: 547
posted
0
Originally posted by vasu dupe: Thanks. I got it.From this I understand that every class we develop should be in a package while using JSPs. Is that true.
Yes, only old version servlet container such as tomcat 3, maybe old version JVM, allows importing java class without package.
Jherald Lacambra
Ranch Hand
Joined: Feb 02, 2005
Posts: 129
posted
0
why is it not allowed to import classes without package in the latter versions of web servers?