java Ï̵߳÷ÓÃHttpClientµÄʵÁ¦
×¢Òâ,Óõ½ÁËÄÚ²¿Àà:
new Thread
(
new Runnable()
{
public void run()
{
try
{
postMethod(POST_URL,page.getVideoId()+"",page.getPid()+"",page.getId()+"",page.getStatus()+"","page url");
}
catch (IOException e)
{
log.error(e.getMessage(), e);
}
}
}
);
ÕâÑù¼È¿ÉµôÓÃÒ»¸öHttpClientµÄ·½·¨ÁË.
¼´Ê¹ÔÚ±»ÇëÇó¶Ë³¬Ê±»ò²»Í¨µÄÇé¿öÏÂ,Ò²²»Ó°Ïì±¾·þÎñÆ÷µÄ·ÃÎÊ.
Ïà¹ØÎĵµ£º
À¬»ø»ØÊÕÆ÷ÊÇÈçºÎ¹¤×÷µÄ£¿ÎÒÏÖÔھͼòµ¥µÄ½éÉÜÒ»ÏÂ
Ê×ÏÈÒªÃ÷È·¼¸µã£º
JavaÊÇÔÚ¶ÑÉÏΪ¶ÔÏó·ÖÅä¿Õ¼äµÄ
À¬»ø»ØÊÕÆ÷Ö»¸úÄÚ´æÓйأ¬Ê²Ã´IO°¡£¬ÍøÂçÁ¬½Ó°¡£¬¹ÜËüPÊÂ
µ±¿ÉÓÃÄÚ´æÊýÁ¿½ÏµÍʱ£¬Sun°æ±¾µÄÀ¬»ø»ØÊÕÆ÷²Å»á±»¼¤»î
ÔÚÀ¬»ø»ØÊÕÆ÷»ØÊÕÀ¬»ø֮ǰ£¬ÎÒÃÇÏÈÀ´Á˽âÒ»ÏÂJava·ÖÅä¶ÔÏóµÄ·½Ê½£¬JavaµÄ¶Ñ¸üÏñÒ»¸ö´«ËÍ´ø£¬Ã¿·ÖÅäÒ» ......
Listener ÊÇServletµÄ¼àÌýÆ÷£¬Ëü¿ÉÒÔ¼àÌý¿Í»§¶ËµÄÇëÇó¡¢·þÎñ¶ËµÄ²Ù×÷µÈ¡£Í¨¹ý¼àÌýÆ÷£¬¿ÉÒÔ×Ô¶¯¼¤·¢Ò»Ð©²Ù×÷£¬±ÈÈç¼àÌýÔÚÏßµÄÓû§µÄÊýÁ¿¡£µ±Ôö¼ÓÒ»¸ö HttpSessionʱ£¬¾Í¼¤·¢sessionCreated(HttpSessionEvent se)·½·¨£¬ÕâÑù¾Í¿ÉÒÔ¸øÔÚÏßÈËÊý¼Ó1¡£³£ÓõļàÌý½Ó¿ÚÓÐÒÔϼ¸¸ö£º
# ServletContextAttributeListener¼àÌý¶ÔServle ......
¼ÙÈçÄãÔÚÒ»¸öÎïÁ÷ÔËÊ乫˾£¬Óиö¿Í»§ÒªÇóÄãΪËûÔËÊäÒ»¶¨ÊýÁ¿µÄ²úÆ·µ½Ä³µØ£¬Ê¹ÓÃijÖÖ½»Í¨¹¤¾ß£®ÄÇÎÒÃǼÙÉèÄãµÄ¹ÜÀí³ÌÐòÖÐÓÐTruckÀ࣬TrainÀ࣬PlaneÀàרÃÅÓÃÀ´ÊµÏÖʹÓò»Í¬½»Í¨¹¤¾ßµÄ³É±¾¼ÆË㣬¶¼Óз½·¨cost(Double weight,Double space);ÄÇô£¬ÎÊÌâ³öÀ´ÁË£®¿Í»§¶ÔÓÚÔËÊäÆ÷ÖÖÀàÊÇ¿ÉÑ¡ÔñµÄ£¬ÄãÊDz»ÊÇÒª¶ÔÿÖÖÔËÊäÆ÷new¸öʵÀý· ......
ΪÁ˱ãÓÚ¹ÜÀí£¬ÏÈÒýÈë¸ö»ù´¡Àࣺ
package algorithms;
/**
* @author yovn
*
*/
public abstract class Sorter<E extends Comparable<E>> {
public abstract void s ......
µÚÒ»ÖÖ·½·¨Îª³£¼ûÇÒÒ×ÓÚÉÏÊÖ
1¡¢ÔÚÓ¦Óÿª·¢ÖУ¬¾³£ÐèҪһЩÖÜÆÚÐԵIJÙ×÷£¬±ÈÈçÿ5·ÖÖÓÖ´ÐÐijһ²Ù×÷
µÈ¡£¶ÔÓÚÕâÑùµÄ²Ù×÷×î·½±ã¡¢¸ßЧµÄʵÏÖ·½Ê½¾ÍÊÇʹÓÃjava.util.Timer¹¤¾ßÀà¡£
private java.util.Timer timer;
timer
= new Timer(true);
timer.schedule(
new java.util.TimerTask() {
public void run() { // ......