Class ServletUtil

java.lang.Object
org.apache.hadoop.util.ServletUtil

@Private @Unstable public class ServletUtil extends Object
  • Field Details

    • HTML_TAIL

      public static final String HTML_TAIL
  • Constructor Details

    • ServletUtil

      public ServletUtil()
  • Method Details

    • initHTML

      public static PrintWriter initHTML(javax.servlet.ServletResponse response, String title) throws IOException
      Initial HTML header.
      Parameters:
      response - response.
      title - title.
      Returns:
      PrintWriter.
      Throws:
      IOException - raised on errors performing I/O.
    • getParameter

      public static String getParameter(javax.servlet.ServletRequest request, String name)
      Get a parameter from a ServletRequest. Return null if the parameter contains only white spaces.
      Parameters:
      request - request.
      name - name.
      Returns:
      get a parameter from a ServletRequest.
    • parseLongParam

      public static long parseLongParam(javax.servlet.ServletRequest request, String param) throws IOException
      parseLongParam.
      Parameters:
      request - request.
      param - param.
      Returns:
      a long value as passed in the given parameter, throwing an exception if it is not present or if it is not a valid number.
      Throws:
      IOException - raised on errors performing I/O.
    • htmlFooter

      public static String htmlFooter()
      HTML footer to be added in the jsps.
      Returns:
      the HTML footer.
    • getRawPath

      public static String getRawPath(javax.servlet.http.HttpServletRequest request, String servletName)
      Parse the path component from the given request and return w/o decoding.
      Parameters:
      request - Http request to parse
      servletName - the name of servlet that precedes the path
      Returns:
      path component, null if the default charset is not supported