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;
  }
예제 #2
0
 public static String getWicketAppPath() {
   Request request = RequestCycle.get().getRequest();
   return request.getContextPath() + request.getFilterPath() + "/";
 }