| | |
| | | import java.io.PrintWriter; |
| | | import java.net.URLEncoder; |
| | | import java.sql.Timestamp; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.Random; |
| | | import java.util.UUID; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * Web帮助类 |
| | |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取请求的参数值 |
| | | * |
| | | * @param req 请求 |
| | | * @param key 参数名 |
| | | * @return 参数值 |
| | | */ |
| | | public static String getReqParamVal(HttpServletRequest req, String key) { |
| | | Map<String, String[]> maps = req.getParameterMap(); |
| | | for (Map.Entry<String, String[]> entry : maps.entrySet()) { |
| | | if (entry.getKey().equalsIgnoreCase(key)) { |
| | | return null == entry.getValue() || 0 == entry.getValue().length ? null : entry.getValue()[0]; |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 获取请求的参数值 |
| | | * |
| | | * @param req 请求 |
| | | * @param key 参数名 |
| | | * @return 参数值 |
| | | */ |
| | | public static String[] getReqParamVals(HttpServletRequest req, String key) { |
| | | Map<String, String[]> maps = req.getParameterMap(); |
| | | for (Map.Entry<String, String[]> entry : maps.entrySet()) { |
| | | if (entry.getKey().equalsIgnoreCase(key)) { |
| | | return entry.getValue(); |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | } |