Hi, For example your application context path is
$web_app$/MyApplication and you want to give url for the image folder inside it, like http://localhost/MyApplication/image than in your servlet where you write FOP code, you need to write below code: String real_path = file:"+getServletContext().getRealPath("/image"); org.apache.fop.configuration.Configuration.put("baseDir",real_path); This will set the base dir for your url which you can use for your relative path. For example you want to give url for the image $web_app$/MyApplication/image/mypic.jpg than your xsl-fo file will have below code <fo:block text-align="center" line-height="40pt" start-indent = "10.0cm"> <fo:external-graphic height="auto" width="auto" content-height="auto" content-width="auto"> <xsl:attribute name="src">url('mypic.jpg')</xsl:attribute> </fo:external-graphic> </fo:block> Hope this will work. Jasmin -----Original Message----- From: Adam Shelley [mailto:[EMAIL PROTECTED] Sent: Friday, March 21, 2003 12:53 PM To: FOP MAILING LIST Subject: url to xml/xsl file in servlet Hello, I know that this has been discussed before but i can't think of the magical search parameters to bring it up on the mail list archives. I am using fop-0.20.5rc2 with the default servlet code and i want to pass a url to the xml and xsl files (they are not located on the same server). I know that people have done this by changing the servlet code to using something other than the 'File' object (i think this is what its using pardom my non java expertise) by changing the line XSLTInputHalder input = new XSLInputHandler(new somethingelse(xmlParam), new somethignelse(xslParam)); but i dunno. I can find examples on doing a xml string as input but not url. -Adam --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
