• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to find the location of the dynamic tmp folder created by JBOSS

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey everyone,


I have a unique situation and was wondering if anyone knows if this can even be done and/or and ideas on the topic I may try:
I am runing my web application through a JBOSS server. Upon startup it builds the WAR file and sends it to my jboss-5.1.0.GA\server\default\tmp folder.
my application builds an xml file that i then have to save to the same folder as my WAR file, but the problem is that every time I start my run my app it generates a random folder within the /tmp folder.
In order for me to send my xml to the folder i would have to locate the path of my WAR file from within the application, or i would have to know name of the folder within the /tmp folder that is being dynamically created for the session.


I know this is explained in the worst way so i will try to show you what i mean:

when i run my application the first time it builds my WAR file in this folder:
jboss-5.1.0.GA\server\default\tmp\4e3f35f-87gz9k-guzu43hg-1-guzu98hv-9u

then i close my eclipse out, reopen it and run it again, and this time it saves here:
jboss-5.1.0.GA\server\default\tmp\4e3f35f-87gz9k-guzu43hg-1-guzua866-9v

it generates the random "4e3f35f..." folder with a new name each run, and in order for me to send my xml file there i need to be able to find that folder name and place it within a String from within the running application. If anyone knows how this can be done or has any ideas i am open to tryin anything.

Thanks a lot,

John
 
john alexa
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
nevermind i figured it out!

i had originally been told this no longer worked in the version of eclipse i was using, however I tried it out of pure spite and it worked perfectly. its actually very easy.

simply place the following line in any of your Servlets or JSP pages:

getServletContext().getRealPath("/")

reply
    Bookmark Topic Watch Topic
  • New Topic