Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Krysty Sullivan
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • 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";
???
%>
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
application.getResourceAsStream("/WEB-INF/myDir/master.xm.xml");
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic