• 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

Accessing a file in an installed application in WebSphere App Server 4.0 Advanced Ed

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After development, you package your web module into a war file and included it in an ear file.
test.ear
- test.war
After installation of the Enterprise Application into the server in WAS Admin console, the directory structure would be like this.
C:\
*WebSphere
*AppServer
*installedApps
*TEST.EAR
*META-INF
*TEST.WAR
*META-INF
*WEB-INF
*myDir
- master.xml
- page3.xsl
*myDir2
- mypage.jsp
Legend: * directory
- file
How will I access master.xml file in my JSP code by providing only the filename?
<%
String myFile = "C:/WebSphere/AppServer/installedApps/TEST.EAR/TEST.WAR/myDir/master.xml";
???
%>
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
application.getResourceAsStream("/WEB-INF/myDir/master.xm.xml");
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic