• Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing the managed bean

 
Jithesh Kumar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I have two war files in my jsf application.I would like to access the managed bean of second war file from the first war file.
Is it possible ?

Thanks in advance,

jithesh kumar
 
Tim Holloway
Bartender
Posts: 18412
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jithesh Kumar wrote:Hello all,

I have two war files in my jsf application.I would like to access the managed bean of second war file from the first war file.
Is it possible ?

Thanks in advance,

jithesh kumar


No. For most practical purposes, each WAR is running in a separate VM and what's in one VM cannot be directly accessed by any other VM.
 
Jithesh Kumar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

thank you for responding..

is it possible if the war is in same webserver ? , if not is there any solution in jsf for the above problem..

thanks,

Jithesh
 
Tim Holloway
Bartender
Posts: 18412
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, as far as resource management goes each webapp is totally isolated from every other webapp. In the Tomcat server, there is exactly one and only one WAR per webapp (and vice versa). In full-stack J(2)EE servers, a webapp may contain multiple WARs, but normally each WAR has its own unique classpath, so they can't share objects directly.

Webapps are supposed to be self-contained and not be looking outside themselves for code resources.

However, if you provide a web service interface (SOAP, REST or whatever) to the services of a class in a WAR, other WARs (webapps) can invoke those functionalities by making HTTP service requests.
 
Jithesh Kumar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is the following possible?

in tomcat there is an attribute called "crosscontext", which i think is used for cross context communication.
And after getting the other context, can we can pass the values of the first war to the second wars(jsp or servlet) through url

like this.../contextA/oneServlet?values=1


Thanks in advance

Jithesh


 
Tim Holloway
Bartender
Posts: 18412
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might find this useful: http://www.softwaresecretweapons.com/jspwiki/apachetomcat

However, do remember that anything that you put in the tomcat shared library part of the classpath MUST be thread-safe!

Incidentally, the idea of providing a common set of functionalities sharable by multiple apps was what Enterprise JavaBeans was created for. However, Tomcat doesn't have built-in EJB support. There are ways to add it, however.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!