@Test public void testFindBaseUrl() throws Exception { Assert.assertNotNull(pdfStreamResult); MockHttpServletRequest request = new MockHttpServletRequest(); request.setLocalName("localhost"); request.setRequestURI("/contextPath/requestURI"); request.setQueryString("queryString"); request.setContextPath("/contextPath"); final String baseUrl = pdfStreamResult.findBaseUrl(request); Assert.assertEquals("http: }
String findBaseUrl(final HttpServletRequest request) { final String baseUrl; if (request == null) { baseUrl = ""; } else { StringBuffer url = request.getRequestURL(); String uri = request.getRequestURI(); String ctx = request.getContextPath(); baseUrl = url.substring(0, url.length() - uri.length() + ctx.length()) + "/"; } return baseUrl; }
PdfStreamResult extends StrutsResultSupport { String findBaseUrl(final HttpServletRequest request) { final String baseUrl; if (request == null) { baseUrl = ""; } else { StringBuffer url = request.getRequestURL(); String uri = request.getRequestURI(); String ctx = request.getContextPath(); baseUrl = url.substring(0, url.length() - uri.length() + ctx.length()) + "/"; } return baseUrl; } }
PdfStreamResult extends StrutsResultSupport { String findBaseUrl(final HttpServletRequest request) { final String baseUrl; if (request == null) { baseUrl = ""; } else { StringBuffer url = request.getRequestURL(); String uri = request.getRequestURI(); String ctx = request.getContextPath(); baseUrl = url.substring(0, url.length() - uri.length() + ctx.length()) + "/"; } return baseUrl; }  }
PdfStreamResult extends StrutsResultSupport { String findBaseUrl(final HttpServletRequest request) { final String baseUrl; if (request == null) { baseUrl = ""; } else { StringBuffer url = request.getRequestURL(); String uri = request.getRequestURI(); String ctx = request.getContextPath(); baseUrl = url.substring(0, url.length() - uri.length() + ctx.length()) + "/"; } return baseUrl; }  void setCssPaths(final String cssPaths); void setRenderer(String renderer); void setContentDisposition(String contentDisposition); void setAllowCaching(boolean allowCaching); }
PdfStreamResult extends StrutsResultSupport { String findBaseUrl(final HttpServletRequest request) { final String baseUrl; if (request == null) { baseUrl = ""; } else { StringBuffer url = request.getRequestURL(); String uri = request.getRequestURI(); String ctx = request.getContextPath(); baseUrl = url.substring(0, url.length() - uri.length() + ctx.length()) + "/"; } return baseUrl; }  void setCssPaths(final String cssPaths); void setRenderer(String renderer); void setContentDisposition(String contentDisposition); void setAllowCaching(boolean allowCaching);  }