PDF Generating Tool Support Forum

HOME   Login   Register    Search




Post a reply
Username:
Subject:
Message body:
Enter your message here, it may contain no more than 60000 characters. 

Font size:
Font colour
Options:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are OFF
Disable BBCode
Do not automatically parse URLs
Confirmation of post
To prevent automated posts the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the Board Administrator.
Confirmation code:
Enter the code exactly as it appears. All letters are case insensitive, there is no zero.
   

Topic review - Url resolving for CSS and images
Post subject:  Re: Url resolving for CSS and images
Thank you for the response.
This makes it perfectly clear how it works. It will probably fix my problem I have with server how can't connect to themselves.
    Post Posted: 19 Oct 2016, 14:26
 
Post subject:  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:

RequestDispatcher dispatcher = httpRequest.getRequestDispatcher(url);
BufferedHttpResponseWrapper wrapper = new BufferedHttpResponseWrapper(httpResponse, debugOn);
dispatcher.include(httpRequest, wrapper);
...				
byte[] ret = wrapper.getOutputAsArray();
    Post Posted: 18 Oct 2016, 17:02
 
Post subject:  Url resolving for CSS and images
Good afternoon,

We are using your product PD4ML for some time.
For resolving the urls for css-files and images we use the URL parameter in the PDML.render function.
But recently we had the problem with one off our customers, that resolving this URL wasn't working. The server could not connect to his own URL.
For now we changed the host-file, so it redirect it's own url to localhost.

But I would like to fix to problem by letting PD4ML get the file directly through our Tomcat instance.
I found the options:
- http://pd4ml.com/api/org/zefer/pd4ml/PD4ML.html#useServletContext(ServletContext)
- http://pd4ml.com/api/org/zefer/pd4ml/PD4ML.html#useHttpRequest(HttpServletRequest,%20HttpServletResponse)
But the documentation off those functions are minimal.
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 .
    Post Posted: 11 Oct 2016, 15:23
 


cron
Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share