HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › Deployment / Configuration issues › Url resolving for CSS and images › Re: Re: Url resolving for CSS and images
> What do those functions do, do they use the context or the request to calculate
> the URL, or do they use some functionality off it’s container, in this case Tomcat .
When httpRequest/httpResponse are set, PD4ML uses a request dispatcher to load local (probably, dynamic) resources, like “/WEBAPP/images/logo.png” or “/page.jsp”
It is done like that:
[language=java:4w4ss1xh]RequestDispatcher dispatcher = httpRequest.getRequestDispatcher(url);
BufferedHttpResponseWrapper wrapper = new BufferedHttpResponseWrapper(httpResponse, debugOn);
dispatcher.include(httpRequest, wrapper);
…
byte[] ret = wrapper.getOutputAsArray();[/language:4w4ss1xh]