code: public static String generate(String controllerPath, String action, String id,  Map<String, String> params) {
  
          StringBuilder uri = new StringBuilder(100);
          
          //prepend slash if missing
          if (controllerPath.charAt(0) != '/') uri.append('/');
          uri.append(controllerPath);
  
          if (action != null) {
              uri.append('/').append(action);
          }
  
          if (id != null) {
              uri.append('/').append(id);
          }
  
          if (params.size() > 0) {
              uri.append('?');
              uri.append(DataCodec.encode(params));
          }
  
          return uri.toString();
      }
docs: Generates a URI for a controller.
  
  @param controllerPath path to controller.
  @param action         action for a controller
  @param id             id on a URI
  @param params         name/value pairs to be used to form a query string.
  @return formed URI based on arguments.