Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27103

    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 .

    #29940

    > 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]

    #29941

    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.

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘Deployment / Configuration issues’ is closed to new topics and replies.