protected String getBaseURL(HttpServletRequest request) { return forcedBaseAddress == null ? BaseUrlHelper.getBaseURL(request) : forcedBaseAddress; }
protected void updateDestination(HttpServletRequest request, String base, AbstractHTTPDestination d) { String ad = d.getEndpointInfo().getAddress(); if (ad == null && d.getAddress() != null && d.getAddress().getAddress() != null) { ad = d.getAddress().getAddress().getValue(); if (ad == null) { ad = "/"; } } // Using HTTP_PREFIX check is safe for ServletController // URI.create(ad).isRelative() can be used - a bit more expensive though if (ad != null && !ad.startsWith(HTTP_PREFIX)) { if (disableAddressUpdates) { request.setAttribute("org.apache.cxf.transport.endpoint.address", base + ad); } else { BaseUrlHelper.setAddress(d, base + ad); } } }
protected void updateDestination(HttpServletRequest request, String base, AbstractHTTPDestination d) { String ad = d.getEndpointInfo().getAddress(); if (ad == null && d.getAddress() != null && d.getAddress().getAddress() != null) { ad = d.getAddress().getAddress().getValue(); if (ad == null) { ad = "/"; } } // Using HTTP_PREFIX check is safe for ServletController // URI.create(ad).isRelative() can be used - a bit more expensive though if (ad != null && !ad.startsWith(HTTP_PREFIX)) { if (disableAddressUpdates) { request.setAttribute("org.apache.cxf.transport.endpoint.address", base + ad); } else { BaseUrlHelper.setAddress(d, base + ad); } } }
protected String getBaseURL(HttpServletRequest request) { return forcedBaseAddress == null ? BaseUrlHelper.getBaseURL(request) : forcedBaseAddress; }
protected void updateDestination(HttpServletRequest request, AbstractHTTPDestination d) { String base = getBaseURL(request); synchronized (d) { String ad = d.getEndpointInfo().getAddress(); if (ad == null && d.getAddress() != null && d.getAddress().getAddress() != null) { ad = d.getAddress().getAddress().getValue(); if (ad == null) { ad = "/"; } } // Using HTTP_PREFIX check is safe for ServletController // URI.create(ad).isRelative() can be used - a bit more expensive though if (ad != null && !ad.startsWith(HTTP_PREFIX)) { if (disableAddressUpdates) { request.setAttribute("org.apache.cxf.transport.endpoint.address", base + ad); } else { BaseUrlHelper.setAddress(d, base + ad); } } } }
protected String getBaseURL(HttpServletRequest request) { return forcedBaseAddress == null ? BaseUrlHelper.getBaseURL(request) : forcedBaseAddress; }
public static URI toAbsoluteUri(String relativePath, Message message) { String base = BaseUrlHelper.getBaseURL( (HttpServletRequest)message.get(AbstractHTTPDestination.HTTP_REQUEST)); return URI.create(base + relativePath); }
public static URI toAbsoluteUri(String relativePath, Message message) { String base = BaseUrlHelper.getBaseURL( (HttpServletRequest)message.get(AbstractHTTPDestination.HTTP_REQUEST)); return URI.create(base + relativePath); }
public void doInvoke(final HttpRequest httpRequest, final HttpResponse httpResponse) throws IOException { String baseURL = BaseUrlHelper.getBaseURL(pattern != null ? new ServletRequestAdapter(httpRequest) { @Override // we have a filter so we need the computed servlet path to not break CXF public String getServletPath() { return pattern; } } : httpRequest); if (!baseURL.endsWith("/")) { baseURL += "/"; } httpRequest.setAttribute("org.apache.cxf.transport.endpoint.address", baseURL); final ClassLoader oldLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(CxfUtil.initBusLoader()); try { destination.invoke(null, httpRequest.getServletContext(), httpRequest, httpResponse); } catch (final Throwable t) { throw new IOException("Failed to invoke AbstractHTTPDestination", t); } finally { CxfUtil.clearBusLoader(oldLoader); } }