package com.bbxyard.util;

import java.util.HashMap;

public class Util {
	public static HashMap<String, String> parseStringParams(String params) {
		HashMap<String, String> map = new HashMap<String, String>();
		String[] attrs = params.split(";");
		for (String attr: attrs) {
			String[] sub = attr.split("=");
			if (sub.length < 2)
				continue;
			map.put(sub[0], sub[1]);
		}
		return map;
	}
}

@@ -20,16 +20,101 @@
 .util;%0A%0A
+import java.text.SimpleDateFormat;%0Aimport java.util.Calendar;%0Aimport java.util.Date;%0A
 import j
@@ -477,10 +477,940 @@
 map;%0A%09%7D%0A
+%09%0A%09// e.g. sfmt %22yyyy-MM-dd HH:mm:ss%22%0A    public static String getCurrentDataTime(String sfmt) %7B%0A        // %E6%A0%BC%E5%BC%8F%E5%8C%96%E5%BD%93%E5%89%8D%E6%97%A5%E6%9C%9F%E6%97%B6%E9%97%B4%0A        Calendar c1 = Calendar.getInstance();%0A        c1.setTime(new Date());%0A        SimpleDateFormat sdf = new SimpleDateFormat(sfmt);%0A        String now = sdf.format(c1.getTime());%0A        return now;%0A    %7D%0A%0A//    public static String getClientAddr(HttpServletRequest request) %7B%0A//        String ip = request.getHeader(%22x-forwarded-for%22);%0A//        if(ip == null %7C%7C ip.length() == 0 %7C%7C %22unknown%22.equalsIgnoreCase(ip)) %7B%0A//            ip = request.getHeader(%22Proxy-Client-IP%22);%0A//        %7D%0A//        if(ip == null %7C%7C ip.length() == 0 %7C%7C %22unknown%22.equalsIgnoreCase(ip)) %7B%0A//            ip = request.getHeader(%22WL-Proxy-Client-IP%22);%0A//        %7D%0A//        if(ip == null %7C%7C ip.length() == 0 %7C%7C %22unknown%22.equalsIgnoreCase(ip)) %7B%0A//            ip = request.getRemoteAddr();%0A//        %7D%0A//        return ip;%0A//    %7D%09%0A
 %7D%0A

add dateUtil