You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "CRANFORD, CHRIS" <Ch...@setech.com> on 2010/09/10 19:31:29 UTC

Servlet Container External Graphics

I am trying to use the external-graphics tag in Apache FOP inside of
a servlet container server (Tomcat).  I want to be able to load the
graphic based on relative paths to the context:

<fo:external-graphic src="images/mylogo.gif"/>

In the Web Application server the logo is found in:

 /tomcat/webapps/myapp/images/mylogo.gif

But I cannot get the image to display.




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Servlet Container External Graphics

Posted by "J.Pietschmann" <j3...@yahoo.de>.
On 10.09.2010 19:31, CRANFORD, CHRIS wrote:
> I am trying to use the external-graphics tag in Apache FOP inside of
> a servlet container server (Tomcat).  I want to be able to load the
> graphic based on relative paths to the context:
>
> <fo:external-graphic src="images/mylogo.gif"/>

Relative URLs are by default resolved against the URL of the
document where they occur.
>
> In the Web Application server the logo is found in:
>
>   /tomcat/webapps/myapp/images/mylogo.gif
>
You can try to set the base URL to "/tomcat/webapps/myapp/",
see
  http://xmlgraphics.apache.org/fop/trunk/embedding.html#user-agent
Instead of hard coding the path, you can use servlet functionality,
like
 
http://tomcat.apache.org/tomcat-4.0-doc/servletapi/javax/servlet/ServletContext.html#getRealPath(java.lang.String)

HTH
J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org