#26446
Hi
We have an architecture with apache tomcat and tomcat have to pass through a proxy.
In developpement environnement with only tomcat everythning works fine. In validation environement with Apache and proxy it doesn’t work.
When we use P4ML.render with a array of url, we have noting displayed in the pdf.
When we use HttpClient (code below), the html works but we don’t have the images.
HttpState initialState = new HttpState();
// Initial set of cookies can be retrieved from persistent
// storage
// and re-created, using a persistence mechanism of choice,
Cookie mycookie = new Cookie(u.getHost(), “JSESSIONID”, sessionId, “/”, null, false);
// and then added to your HTTP state instance
initialState.addCookie(mycookie);
// Get HTTP client instance
HttpClient httpclient = new HttpClient();
//httpclient.getHostConfiguration().setProxyHost(new ProxyHost(“dmz-proxy”,8888));
httpclient.getHttpConnectionManager().getParams().setConnectionTimeout(300);
httpclient.setState(initialState);
// RFC 2101 cookie management spec is used per default
// to parse, validate, format & match cookies
httpclient.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
// Get HTTP GET method
GetMethod httpget = new GetMethod(strURL);
httpget.setFollowRedirects(true);
// Execute HTTP GET
int result = httpclient.executeMethod(httpget);
charset =httpget.getResponseCharSet();
string.append(new String(httpget.getResponseBody(), charset));
Can you correct the problem and use httpclient for your connections ?
Regards
Kefah & Jean-Paul