private Url encodeSharedResourceUrl(Url url) {
    if (url != null) {
      Request request = RequestCycle.get().getRequest();

      StringBuilder urlBuilder = new StringBuilder();
      urlBuilder.append(request.getContextPath());
      urlBuilder.append(request.getFilterPath());
      urlBuilder.append(PortletFilter.SHARED_RESOURCE_URL_PORTLET_WINDOW_ID_PREFIX);
      urlBuilder.append(
          Base64.encodeBase64URLSafeString(ThreadPortletContext.getWindowID().getBytes()));
      urlBuilder.append('/');
      urlBuilder.append(url.toString());

      url = Url.parse(urlBuilder.toString());
    }

    return url;
  }
Exemplo n.º 2
0
 public static String getWicketAppPath() {
   Request request = RequestCycle.get().getRequest();
   return request.getContextPath() + request.getFilterPath() + "/";
 }