public class HttpServletUtil extends Object
| 构造器和说明 |
|---|
HttpServletUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addHeader(javax.servlet.http.HttpServletResponse response,
String name,
String value) |
static void |
downloadFileRanges(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Long fileSize,
String fileName,
String contentType,
InputStream in)
支持断点续传的驱动下载
|
static Object |
getAttribute(javax.servlet.http.HttpServletRequest request,
String name) |
static String |
getBodyString(BodyReaderHttpServletRequestWrapper bodyRequest) |
static String |
getCharacterEncoding(javax.servlet.http.HttpServletRequest request) |
static String |
getContentType(javax.servlet.http.HttpServletRequest request) |
static String |
getHeader(javax.servlet.http.HttpServletRequest request,
String name) |
static Enumeration<String> |
getHeaderNames(javax.servlet.http.HttpServletRequest request) |
static Enumeration<String> |
getHeaders(javax.servlet.http.HttpServletRequest request,
String name) |
static String |
getIP(javax.servlet.http.HttpServletRequest request) |
static String |
getParameter(javax.servlet.http.HttpServletRequest request,
String name) |
static Enumeration<String> |
getParameterNames(javax.servlet.http.HttpServletRequest request) |
static String[] |
getParameterValues(javax.servlet.http.HttpServletRequest request,
String name) |
static PrintWriter |
getPrintWriter(javax.servlet.http.HttpServletResponse response) |
static void |
print(javax.servlet.http.HttpServletResponse response,
String content) |
static void |
responseError(javax.servlet.http.HttpServletResponse response,
Map<Integer,String> errorMap,
Integer errorCode) |
static void |
sendError(javax.servlet.http.HttpServletResponse response,
int sc) |
static void |
setCharacterEncoding(javax.servlet.http.HttpServletResponse response,
String charset) |
static void |
setContentLength(javax.servlet.http.HttpServletResponse response,
int len) |
static void |
setContentType(javax.servlet.http.HttpServletResponse response,
String type) |
static void |
setDateHeader(javax.servlet.http.HttpServletResponse response,
String name,
long value) |
static void |
setHeader(javax.servlet.http.HttpServletResponse response,
String name,
String value) |
static void |
setStatus(javax.servlet.http.HttpServletResponse response,
int sc) |
public static String getIP(javax.servlet.http.HttpServletRequest request)
public static String getCharacterEncoding(javax.servlet.http.HttpServletRequest request)
public static String getContentType(javax.servlet.http.HttpServletRequest request)
public static Enumeration<String> getParameterNames(javax.servlet.http.HttpServletRequest request)
public static Enumeration<String> getHeaderNames(javax.servlet.http.HttpServletRequest request)
public static Enumeration<String> getHeaders(javax.servlet.http.HttpServletRequest request, String name)
public static String getHeader(javax.servlet.http.HttpServletRequest request, String name)
public static String getParameter(javax.servlet.http.HttpServletRequest request, String name)
public static String[] getParameterValues(javax.servlet.http.HttpServletRequest request, String name)
public static Object getAttribute(javax.servlet.http.HttpServletRequest request, String name)
public static String getBodyString(BodyReaderHttpServletRequestWrapper bodyRequest)
public static void setContentType(javax.servlet.http.HttpServletResponse response,
String type)
public static void setContentLength(javax.servlet.http.HttpServletResponse response,
int len)
public static void setCharacterEncoding(javax.servlet.http.HttpServletResponse response,
String charset)
public static void addHeader(javax.servlet.http.HttpServletResponse response,
String name,
String value)
public static void setHeader(javax.servlet.http.HttpServletResponse response,
String name,
String value)
public static void sendError(javax.servlet.http.HttpServletResponse response,
int sc)
throws IOException
IOExceptionpublic static void setDateHeader(javax.servlet.http.HttpServletResponse response,
String name,
long value)
public static void setStatus(javax.servlet.http.HttpServletResponse response,
int sc)
public static PrintWriter getPrintWriter(javax.servlet.http.HttpServletResponse response) throws IOException
IOExceptionpublic static void print(javax.servlet.http.HttpServletResponse response,
String content)
public static void responseError(javax.servlet.http.HttpServletResponse response,
Map<Integer,String> errorMap,
Integer errorCode)
public static void downloadFileRanges(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Long fileSize,
String fileName,
String contentType,
InputStream in)
throws IOException
IOExceptionCopyright © 2023. All rights reserved.