• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to get J2EE Application Name

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

I need to write code (Servlet/EJB) in an application that can figure out the name of the application it is deployed within. The name of the application is decleared in the Application.xml file.
I am working with more than one EAR file deployed on WebLogic Server 8.1 SP4

Thanks a lot for your response.

Osita Agbo.
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Osita,

You might consider storing the information inside your packages and retrieve them at runtime. More exactly you might store the next information inside of the manifest.mf file(s):

Next you can use the java.lang.Package class in order to get all these information at runtime. This class has specific methods like getName, getImplementationTitle, getSpecificationTitle, etc.
Regards.
 
Just the other day, I was thinking ... about this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic