File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes calling java file from jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "calling java file from jsp" Watch "calling java file from jsp" New topic
Author

calling java file from jsp

amal shah
Ranch Hand

Joined: May 05, 2006
Posts: 92
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

Joined: Jan 10, 2002
Posts: 60740
    
  65

You'll need to import the WriteLog class.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
amal shah
Ranch Hand

Joined: May 05, 2006
Posts: 92
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
Marshal

Joined: Mar 22, 2005
Posts: 41034
    
  43
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?


Ping & DNS - my free Android networking tools app
amal shah
Ranch Hand

Joined: May 05, 2006
Posts: 92
hello,



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

help appreciated
cheers
amal shah
dhwani mathur
Ranch Hand

Joined: May 08, 2007
Posts: 621
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

Joined: May 05, 2006
Posts: 92
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

Joined: Dec 11, 2004
Posts: 13410

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?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
 
subject: calling java file from jsp
 
Similar Threads
Error while exporting to PDF using Jasper Report
Question in Simple tag with body content "JSP"
Configure Tomcat with Crystal Report
Problem with Custom Error Page
URL Encoding Decoding problem