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 importing class to jsp from outer project and calling a method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "importing class to jsp from outer project and calling a method" Watch "importing class to jsp from outer project and calling a method" New topic
Author

importing class to jsp from outer project and calling a method

alex kravits
Greenhorn

Joined: Aug 22, 2012
Posts: 1
Hi for all good people on this site. I have a project that i need to write a web interface for it, which can call some methods in classes of the existing project. I wrote a jsp and imported a classes that i need to call methods in them. Also i know that to import classes i must to add a class jar to web-inf directory or to add whole existing project to class-path. but when i am trying to import instantiate with i get

javax.servlet.ServletException: java.lang.InstantiationException: class BL.TaxiStation : java.lang.InstantiationException: BL.TaxiStation

My jsp:



in line 19.

The class im trying to import TaxiStation.java:



as i see it is imported because a can reach its methods in <jsp:usebean>

The error i got



classpath and projects structre




Another question maybe instead of trying to import the classes and methods I should work with data base, which i also have in project.

Thank you all. and sorry for such a long post.




[Thumbnail for Clipboard02.jpg]


[Thumbnail for Clipboard05.jpg]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: importing class to jsp from outer project and calling a method