• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

how do files of one war file will access files of other war file

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do files of one .war file will access files of other .war file both deployed in the same server. pls reply.
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"pls" is not a word. Please use real words such as "please" when posting to the forums.

thanks,
bear
Forum sheriff
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Parul Tripathi:
how do files of one .war file will access files of other .war file both deployed in the same server. pls reply.



Do you mean one web application making request to another web application ?
 
Parul Tripathi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes i want one web application making request to another web application.
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Synchronizing file access across contexts is tricky. Or is just read-only access?

Obviously, you'need to know the path to the file, which includes the name of the other web app, and its internal structure. This goes a bit against the encapsulation one is trying to achieve with web apps. Maybe it would be possible for the web apps to only access their own files, and have the others make HTTP requests to it? Or move the common files to a shared directory somewhere else?
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah. Now I see that you're actually talking about requests, not files.

You can use the java.net.HttpUrlConnection class to make HTTP requests, or -for more features- the Jakarta Commons HttpClient library. What kind of data were you thinking of sending back to the calling web app?
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a method on the ServletContext object that allows for access to another WAR's servlet context - DEPENDING ON THE VENDOR's IMPLEMENTATION. If you call the getContext(java.lang.String uripath) with another WAR's servlet context - it will give you a reference to that web apps servlet context. I beleive that is the default implementation for weblogic, but again, your mileage may vary
 
this llama doesn't want your drama, he just wants this tiny ad for his mama
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic