• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling java file from jsp

 
amal shah
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
i am quite new to jsp. my aim is to call a java method from jsp but it gives compile time error. The code is:





And the WriteLog class file is in WEB-INF/classes folder.
The error given is---> cannot resolve symbol WriteLog

help appreciated
cheers
amal shah
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to import the WriteLog class.
 
amal shah
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
what i infer from your statement is to put WriteLog class in a package say "abc" and the abc folder in WEB-INF/classes folder and have a import statement. But still it say's---> cannot resolve symbol.

help appreciated
cheers
amal shah
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the import statement look like? Have you restarted the web app since putting the class file into the WEB-INF/classes/abc directory?
 
amal shah
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,



i did restart the tomcat....but still it gives the same compile time error

help appreciated
cheers
amal shah
 
dhwani mathur
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi amal

you must put your WriteLog.class file in that folder
not WriteLog.java file so please check onto it.........
may this solves your problem........



Dhwani:>Swimmers never weep.
 
amal shah
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
of-course,class file was put into it...i.e. WEB-INF/classes/abc folder....not able to solve the problem..


help appreciated
cheers
amal shah
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by amal shah:
...of-course,class file was put into it...i.e. WEB-INF/classes/abc folder...


This implies that it should be obvious to everyone that you put the class file in that directory. Since, in your first post, you wrote "And the WriteLog class file is in WEB-INF/classes folder." it is anything but obvious.
See AvoidRedHerrings to find out how you have just wasted the time of those trying to help you.

Maybe there are some other details that you haven't mentioned yet?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic