Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

class imported but cannot use method  RSS feed

 
neelesh kumar
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a BankCommons java file, compiled nd packaged the class file under WEB-INF/classes/com/onlinebank/

I imported the class in the jsp file as <@page import="com.onlinebank.BankCommons.*" % >

I ran it through tomcat....the class is being imported..no error there.....but when i try to use one of the method in the class as : BankCommons.update, ...it throws an error that BankCommons cannot be resolved...

Please help!
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try clearing up Tomcat's cache which you can find under the TOMCAT_HOME/Catalina/Work directory.
 
neelesh kumar
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cleared the cache....no effect
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
neelesh kumar wrote:Cleared the cache....no effect


I do not remember the exact path, but there is a folder with the name of your Webapp that contains all your compiled JSP files. I guess that folder needs to be cleared.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Advice #1: Stop using Java code in a JSP. Scriptlets have been obsolete for 13 years now. 13 years!

Advice #2: Fix your import statement. It's wrong. (No, I'm not going to tell you how. Try it in a Java class and you'll see the problem.)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!