¶ÁÈ¡formÊý¾Ýʱ£¬java·´ÉäµÄÒ»µãÓ¦ÓÃ
package com.gis.biz;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
public class ObjectRef {
//Ó÷´ÉäÌî³ä¶ÔÏ󣬵õ½¶ÔÏó£¬
public static Object getInstance(Class ccc, Map map)
throws ClassNotFoundException, InstantiationException,
IllegalAccessException, SecurityException, NoSuchFieldException,
NoSuchMethodException, IllegalArgumentException, InvocationTargetException{
String cname = ccc.getName();
Object obj = null;
Class c = Class.forName(cname);
obj = c.newInstance();
Set set = map.keySet();
Iterator it = set.iterator();
while(it.hasNext()){
String methodName = (String)it.next();
System.out.println();
Field ff = c.getDeclaredField(methodName);
Object value= map.get(methodName);
String mName = "set"+methodName.substring(0, 1).toUpperCase()+methodName.substring(1);
Method m = c.getDeclaredMethod(mName, ff.getType());
m.invoke(obj, value);
}
return obj;
}
//°Ñform ±íµ¥ÖеÄÊý¾Ýת»¯³ÉmapÀïµÄÊôÐÔ--Öµ
public static Map getMap(HttpServletRequest request){
Map map = new HashMap();
Enumeration en =request.getParameterNames();
while(en.hasMoreElements()){
String formName = (String) en.nextElement();
String l = request.getParameter(formName);
map.put(formName, l);
}
return map;
}
}
ÕâÊDZ¾ÈËÔÚ×öweb ÏîĿʱ µÄÒ»µãСµÄÓ¦Óã¬Äܹ
Ïà¹ØÎĵµ£º
Ubuntu Linux Install Sun Java Development Kit ( JDK ) and Java Runtime Environment ( JRE )
by Vivek Gite
Q.
How do I install Sun
Java Development Kit (JDK) and Java Runtime Environment (JRE) under
Ubuntu Linux? It appears that there are multiple JRE installed by
default under Ubuntu. ......
¶þ·Ö²éÕÒ·¨ºÍÏßÐÔ²éÕÒ·¨
¶þ·Ö²éÕÒ·¨ÊÇÒ»ÖÖ±ÈÆÕͨÏßÐÔ²éÕÒ¿ìµÃ¶àµÄ²éÕÒËã·¨£¬µ«Ö»ÊÊÓÃÓÚÓÐÐò¼¯ºÏµ±ÖС£ÄÃÉýÐòÅÅÐòºóµÄÕûÐÍÊý×éÀ´Ëµ£¬¶þ·Ö·¨¾ßÌåµÄʵÏÖÔÀíÊÇ£ºÏÈ°Ñ´ý²éÕÒÊýaÓëÊý×éÖмäµÄÄǸöÊýx¶Ô±È£¬Èç¹ûÏàµÈ£¬Ö±½Ó·µ»ØxµÄË÷Òý£»Èç¹ûa´óÓÚx£¬ÔòÅųýµôÊý×éµÄÇ°ÃæÒ»°ë£¨°üÀ¨x£©£¬½Ó×ÅÄÃaÓëÊ£ÏÂÒ»°ëÊý×éÖмäµÄÄǸöÊýx¶Ô±È£¬Èç ......
1. ¼òµ¥ÀàÐÍÊÇ°´Öµ´«µÝµÄ
¡¡¡¡Java ·½·¨µÄ²ÎÊýÊǼòµ¥ÀàÐ͵Äʱºò£¬ÊÇ°´Öµ´«µÝµÄ (pass by value)¡£ÕâÒ»µãÎÒÃÇ¿ÉÒÔͨ¹ýÒ»¸ö¼òµ¥µÄÀý×ÓÀ´ËµÃ÷£º
/* Àý 1 */
/**
* @(#) Test.java
* @author fancy
*/
public class Test {
public static void test(boolean test) {
&nb ......
×¢Ê͵ÄÔÔò
1¡¢ ×¢ÊÍÐÎʽͳһ
ÔÚÕû¸öÓ¦ÓóÌÐòÖУ¬Ê¹ÓþßÓÐÒ»ÖµıêµãºÍ½á¹¹µÄÑùʽÀ´¹¹Ôì×¢ÊÍ¡£Èç¹ûÔÚÆäËûÏîÄ¿×é·¢ÏÖËûÃǵÄ×¢Ê͹淶ÓëÕâ·ÝÎĵµ²»Í¬£¬°´ÕÕËûÃǵĹ淶д´úÂ룬²»ÒªÊÔͼÔڼȳɵĹ淶ϵͳÖÐÒýÈëеĹ淶¡£
2¡¢ ×¢Ê͵ļò½à
ÄÚÈÝÒª¼òµ¥¡¢Ã÷ÁË¡¢º¬Òå׼ȷ£¬·ÀÖ¹×¢Ê͵ĶàÒåÐÔ£¬´íÎóµÄ×¢ÊͲ»µ«ÎÞÒæ·´¶øÓк¦¡£
......