File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inter servlet access in single web server.

 
Tejas Aryan
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The tomcat runs on one JVM. Suppose the tomcat has 2-3 web applications, say A, B and C. A class in web app A declares a static variable int xA = 5; Since there is only one JVM this variable is created there. My question is can class in other web application,B, access this variable through some means if not directly ?. I don't want to use any web services/ rmi etc.
 
Tejas Aryan
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read in one of the forum that tomcat's inbuilt jndi can be used to attach the object and then this object can be referenced from other servlet context. I have not tried this, though. However, even if this works this will tie my application to tomcat. Any other options ?
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using JNDI to access/use resources is a standard JEE practice and does not tie your application with any Application Server.

I a new Application Server, you have to create JNDI resources again and use them, that' all.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic