Search code examples
xsltpathxsl-fojdeveloper

Jdeveloper Weblogic: How to get the deployed image path


I'm setting up a web application that should generate the pdf of the selected row from a table. The pdf has a background image ($image.png) that is located in a different folder from the XSL file ($template).

The managed bean get's the template and with a XML generate a PDF.

Path:

bean (ViewController\Application Sources\view\bean)

$image (ViewController\Web Content\resources\background)

$template (ViewController\Web Content\resources\stylesheet)

The only way i was able to get the image was using the absolute path (file:\\C:\some\folder\image.png).

<fo:layout-master-set>
    <fo:simple-page-master page-height="29.7cm" page-width="21cm">

        <fo:region-body background-image="file:\\\background/image.png"/>

    </fo:simple-page-master>
</fo:layout-master-set>

I'm trying to get the relative project path when the project is launched with the Weblogic.


Solution

  • The path to the file starts from the context-root, to get that I deployed the project in the local weblogic, and from the console, I got the context-root.

    I'm still not sure of the currect path for my problem, but for the moment i was able to display the image using:

    <fo:region-body background-image="url('http://127.0.0.1:7101/context- 
    root/path/to/img/image.png')"/>
    

    Note: I now use the 'url' tag instead of 'file:///' tag.

    The next step is to get the relative path.

    I'd like to thank every one who tried to answer my question.