Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make the servet to invoke the independent java class which is not residing in the web app.

 
avitra kumar nimmadala
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I have a web application of which the servet has to invoke the independent java class which is not residing in the web application.
Please suggest me if there is any solution to iplement the above requirement.

thanks in advance.

Regards,
Avitra.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Classes used in the web app have to be in a place where one of the involved classloaders can get at them. Usually that's WEB-INF/lib or WEB-INF/classes in the wbe app itself, or maybe in a shared directory of the servlet container, or -as a last resort- via the extension mechanism of the JVM. If none of these work, then it's either really tricky (think custom classloaders) or impossible.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why can you just not include the class on the web app like normal?
 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
classes that you can invoke in your Servlet must be placed in the specified directory of your webapp that is WEB-INF/classes
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shivam singhal wrote:classes that you can invoke in your Servlet must be placed in the specified directory of your webapp that is WEB-INF/classes

Not correct. That's just one of the places it can go. Ulf has already pointed out the appropriate locations.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic