文件名称:pageDate封装参数,不用实体类
文件大小:3KB
文件格式:JAVA
更新时间:2021-11-18 04:42:42
pageDate
package com.model;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
/**
* 说明:参数封装Map
* @version
*/
public class PageData extends HashMap implements Map{
private static final long serialVersionUID = 1L;
Map map = null;
HttpServletRequest request;
public PageData(HttpServletRequest request){
this.request = request;
Map properties = request.getParameterMap();
Map returnMap = new HashMap();
Iterator entries = properties.entrySet().iterator();
Entry entry;
String name = "";
String value = "";
while (entries.hasNext()) {
entry = (Entry) entries.next();
name = (String) entry.getKey();
Object valueObj = entry.getValue();
if(null == valueObj){
value = "";
}else if(valueObj instanceof String[]){
String[] values = (String[])valueObj;
for(int i=0;i