Jerome Munchenberg wrote:
Hello,
I am developing a web service which returns a PDF generated by FOP
(fop-0.94) which must include an image. The web service is deployed as
an EAR to a WebLogic server, and the image to be inserted into the PDF
is contained within this EAR.
You might try the JAR scheme, but I am not sure whether that scales well
to a EAR. Another option is to use the real filepath (you can get the
real unpacked EAR location through your web application server
interface, I believe), or a relative path (often it is quite easy to get
the WEB-INF directory and go from there).
If all fails, the next easiest thing to do is to use the public URI
which would also be accessible from your website to retrieve that same
file. It is probably best to use localhost as server to prevent an extra
server roundtrip.
If you don't like any of these scenarios because of their lack of
scalability, start using Catalogs (see OASIS website) and use a
URIResolver (possibly with a specific scheme) to resolve the catalogs
unambiguously regardless the platform / system / paths your services are
running on.
How do I correctly access the image embedded in the EAR? I have been
able to use a file file path when testing on my own box, but this is
obviously unsuitable for other environments!
You were lucky that it worked, because if a file path is allowed, than
that's a bug in the FOP implementation: XSL-FO prescribes that only a
URI is allowed. To go from a filepath to a URI you should rewrite it
something like "file:///c:/project/scr/certificate.gif" (note the
forward slashes!).
src="C:\Project\src\au\com\aaa\services\certificate.gif"
HTH,
Cheers,
-- Abel Braaksma
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]