类 ServletUtils


  • public abstract class ServletUtils
    extends Object
    • 构造器详细资料

      • ServletUtils

        public ServletUtils()
    • 方法详细资料

      • getCurrentRequestCapabilities

        public static com.blueconic.browscap.Capabilities getCurrentRequestCapabilities()
      • getRemoteIp

        public static String getRemoteIp​(javax.servlet.http.HttpServletRequest request)
      • getCurrentRequest

        public static javax.servlet.http.HttpServletRequest getCurrentRequest()
      • getCurrentResponse

        public static javax.servlet.http.HttpServletResponse getCurrentResponse()
      • getCurrentSession

        public static javax.servlet.http.HttpSession getCurrentSession()
      • getCurrentRawSessionId

        public static String getCurrentRawSessionId()
      • getServletContext

        public static javax.servlet.ServletContext getServletContext()
      • getServletRootPath

        public static String getServletRootPath()
      • getRawSessionId

        public static String getRawSessionId​(String sessionId)
      • getCurrentRequestParamMap

        public static Map<String,​String> getCurrentRequestParamMap()
      • responseError

        @Deprecated
        public static void responseError​(String error)
        已过时。
      • responseError

        public static void responseError​(HttpErrorMessage errorMessage)
      • responseError

        public static void responseError​(int httpStatus,
                                         String error)
      • responseMessage

        public static void responseMessage​(javax.servlet.ServletResponse response,
                                           String message)
      • responseMessage

        public static void responseMessage​(javax.servlet.ServletResponse response,
                                           int httpStatus,
                                           String message)
      • getRequestUri

        public static String getRequestUri()
      • getContextPath

        public static String getContextPath()
      • getRequestUri

        public static String getRequestUri​(javax.servlet.http.HttpServletRequest request)
      • getRequestUrl

        public static String getRequestUrl()
      • getRequestUrl

        public static String getRequestUrl​(javax.servlet.http.HttpServletRequest request)
      • addCookie

        public static void addCookie​(javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response,
                                     String cookieName,
                                     String cookieValue)
      • addCookie

        public static void addCookie​(javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response,
                                     String cookieName,
                                     String cookieValue,
                                     int expirySeconds)
      • getCookie

        public static javax.servlet.http.Cookie getCookie​(javax.servlet.http.HttpServletRequest request,
                                                          String cookieName)