code: @Override
      public void doGet(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
          boolean xml = false;
          int numPIDs = 1;
          String namespace = null;
  
          Context context =
                  ReadOnlyContext.getContext(HTTP_REQUEST.REST.uri, request);
  
          // Get optional supplied parameters.
          for (Enumeration<?> e = request.getParameterNames(); e.hasMoreElements();) {
              String name = URLDecoder.decode((String) e.nextElement(), "UTF-8");
              if (name.equalsIgnoreCase("xml")) {
                  xml = Boolean.parseBoolean(request.getParameter(name));
              }
              if (name.equalsIgnoreCase("numPIDs")) {
                  numPIDs =
                          new Integer(URLDecoder.decode(request
                                  .getParameter(name), "UTF-8")).intValue();
              }
              if (name.equalsIgnoreCase("namespace")) {
                  namespace =
                          URLDecoder.decode(request.getParameter(name), "UTF-8");
              }
          }
          try {
              getNextPID(context, numPIDs, namespace, xml, response);
          } catch (AuthzException ae) {
              throw RootException.getServletException(ae,
                                                      request,
                                                      ACTION_LABEL,
                                                      EMPTY_STRING_ARRAY);
          } catch (Throwable th) {
              final String msg = "Unexpected error getting next PID";
              logger.error(msg, th);
              throw new InternalError500Exception(msg,
                                                  th,
                                                  request,
                                                  ACTION_LABEL,
                                                  "Internal Error",
                                                  EMPTY_STRING_ARRAY);
          }
      }
docs: <p>
  Process the Fedora API-M-LITE request to generate a list of next
  available PIDs. Parse and validate the servlet input parameters and then
  execute the specified request.
  </p>
  
  @param request
  The servlet request.
  @param response
  servlet The servlet response.
  @throws ServletException
  If an error occurs that effects the servlet's basic operation.
  @throws IOException
  If an error occurrs with an input or output operation.