This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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]

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: importing class to jsp from outer project and calling a method
 
Similar Threads
HAS-A relationship problem
n-dimensioned array in Java
Finding a prime factor
Loading Time
Update cells of Table