Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

importing class to jsp from outer project and calling a method

 
alex kravits
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Clipboard02.jpg
error
[Thumbnail for Clipboard02.jpg]
Clipboard05.jpg
clath path and projects structure
[Thumbnail for Clipboard05.jpg]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic