• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Weblogic 9.2 : Specifying path of file generated from application

 
Viral Shah
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a web application deployed on weblogic 9.2 as WAR file. ( Auto deploy)
For some functionality, the web application creates some files on the server. How to specify the path for the file to be created ?

For reading files we understand that getRealPath doesnt work and one has to use getResource.
But what is the equivalent solution to writing files where one needs to give some relative path to indicate where to create the file ?
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

you can use an alias mapped on weblogic.xml to point to a static resources directory.

http://download.oracle.com/docs/cd/E12840_01/wls/docs103/webapp/weblogic_xml.html#wp1039396


another thing you may use but I STRONGLY wouldn't recommend is enabling getRealPath to work under archived deploys but that goes against J2EE specification.

To do that:
Select your domain_name in domain tree under admin console, than select web application and the las check box will be to enable archived getRealPath.

[]s
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic