示例1: getHeaderInfo

点赞 4
import javax.servlet.http.HttpServletRequest; //导入方法依赖的package包/类/** * Returns a string containg all the HTTP request headers and their values. * * @param req HTTP request * @return String containg all the HTTP request headers and their values */ public static String getHeaderInfo(HttpServletRequest req) { StringBuilder builder = new StringBuilder("HTTP request headers :"); EnumerationheaderNames = req.getHeaderNames(); while (headerNames.hasMoreElements()) { String headerName = headerNames.nextElement(); builder.append("\n\"").append(headerName).append("\" => \""); Enumerationheaders = req.getHeaders(headerName); while (headers.hasMoreElements()) { String headerValue = headers.nextElement(); builder.append(headerValue); if (headers.hasMoreElements()) { builder.append(","); } } builder.append("\""); } return builder.toString(); }
开发者ID:vrk-kpa,项目名称:xrd4j,代码行数:27,代码来源:AdapterUtils.java

示例2: MinijaxHttpHeaders

点赞 3
import javax.servlet.http.HttpServletRequest; //导入方法依赖的package包/类public MinijaxHttpHeaders(final HttpServletRequest request) { headers = new MultivaluedHashMap