code: public static String url(PMSession session, String url, Boolean confirm, String prefix) {
          if (session != null) {
              final String contextPath = PMEntitySupport.getInstance().getContext_path();
              final StringBuilder sb = new StringBuilder();
              if (prefix != null) {
                  sb.append(prefix);
              }
              if (confirm) {
                  sb.append("loadPageConfirm('");
              } else {
                  sb.append("loadPage('");
              }
              sb.append(contextPath);
              sb.append("/");
              sb.append(session.getStringEncrypter().encrypt(
                      (url.startsWith("/")) ? url.substring(1) : url));
              sb.append(".jpm')");
              return sb.toString();
          } else {
              return url;
          }
      }
docs: Builds a jpm url based on given url
  
  @param session Session user. Cannot be null
  @param url Url to be built, <b>without</b> context path
  @param confirm if confirm is true, uses loadPageConfirm instead of
  loadPage
  
  @return ready to use url