java¹ýÂËÆ÷¶ÔextÒì²½ÇëÇóÌøת
1.java¹ýÂËÆ÷¶ÔextÒì²½ÇëÇóÌøת
Óû§·ÃÎʳ¬Ê±
½â¾öÁ½ÖÖÇé¿öϵÄÓû§·ÃÎʳ¬Ê±¡£
a£©ÆÕͨhttpÇëÇóµÄsession³¬Ê±¡£
b£©Òì²½httpÇëÇóµÄsession³¬Ê±£¬Ê¹ÓÃextºó´ó²¿·ÖµÄ½çÃæˢж¼ÊÇÒì²½µÄajaxÇëÇó¡£
²»¹ÜÊÇÄÇÖÖÀàÐ͵ÄhttpÇëÇó×ÜÊÇ¿ÉÒÔÓÉÒ»¸ö¹ýÂËÆ÷À´²¶×½¡£
·ÖÀࣺÆÕͨhttpÇëÇóµÄheader²ÎÊýÖÐûÓÐx-requested-with:XMLHttpRequestÍ·ÐÅÏ¢£¬¶øÒì²½µÄÓС£
Æäʵ¶ÔÓÚ³£¼ûµÄajax¿ò¼Ü£¬headerÖл¹Óбêʾ×Ô¼ºÉí·ÝµÄheaderÐÅÏ¢¡£
¶ÔÓÚÆÕͨµÄhttpÇëÇ󣬷¢ÏÖsession³¬Ê±ºóÖ±½ÓÖض¨Ïòµ½Ò»¸ö³¬Ê±Ò³Ã棬ÏÔʾ·ÃÎʳ¬Ê±¡£
¶ÔÓÚÒì²½httpÇëÇ󣬷¢ÏÖsession³¬Ê±ºóÔòÏòÇëÇóµÄresponseÖÐдÈëÌض¨µÄ³¬Ê±Í·ÐÅÏ¢£¬¿Í»§¶Ëajax¶ÔÏó¼ì²â
Í·ÐÅÏ¢£¬·¢ÏÖÓг¬Ê±×´Ì¬±êÖ¾ºóµ÷ÓÃÏÔʾ³¬Ê±ÐÅÏ¢µÄjavascript·½·¨£¬ÌáʾÓû§·ÃÎʳ¬Ê±¡£
·þÎñÆ÷¶Ësession³¬Ê±ºóÔÚ¹ýÂËÆ÷ÖÐΪresponseÌí¼ÓеÄÍ·ÐÅÏ¢£¬±ê¼Ç¸ÃÇëÇó³¬Ê±£º
Js´úÂë
if(r.getHeader("x-requested-with")!=null
&& r.getHeader("x-requested-with").equalsIgnoreCase("XMLHttpRequest")){
response.setHeader("sessionstatus","timeout");
}
if(r.getHeader("x-requested-with")!=null && r.getHeader("x-requested-with").equalsIgnoreCase("XMLHttpRequest")){ response.setHeader("sessionstatus","timeout"); }
ʹÓÃExt.Ajaxt¶ÔÏóÍê³ÉÒì²½ÇëÇóµÄ½»»¥£¬Ext.AjaxÊǵ¥ÊµÀý¶ÔÏ󣨷dz£ÖØÒª£¬È«¾Öµ¥Ò»Ext.AjaxʵÀý£¡£©¡£
×¢²áExt.AjaxµÄrequestcompleteʼþ£¬Ã¿¸öajaxÇëÇó³É¹¦ºóÊ×ÏÈÏìÓ¦¸Ãʼþ¡£ÔÚ¸ÃʼþµÄ»Øµ÷º¯ÊýÀïÃæÅжÏ
·ÃÎÊÇëÇóÊÇ·ñ³¬Ê±¡£Ê¹ÓÃExt.Ajax¶ÔÏóµÄºÃ´¦ÊÇ£¬Ö»ÐèÒªÒýÈëÒ»¸ö°üº¬Á˼¸Ðг¬Ê±´¦Àí´úÂëµÄjsÎļþ£¬¾Í¿ÉÒÔ
Ϊµ±Ç°Ó¦ÓÃÔö¼Ó³¬Ê±´¦Àí¹¦ÄÜ£¬ÔÓдúÂë²»ÐèÒª×öÈκÎÐ޸ġ£
ʹÓÃExt.Ajaxt¶ÔÏóÍê³ÉÒì²½ÇëÇó½»»¥£¬¼ÙÈçcheckUserSessionStatusÊÇÄãµÄ»Øµ÷·½·¨£¬Ã¿¸öÒ³ÃæÒýÓãº
Js´úÂë
Ext.Ajax.on('requestcomplete',checkUserSessionStatus, this);
function checkUserSessionStatus(conn,response,options){
//ExtÖØзâ×°ÁËresponse¶ÔÏó
if(typeof response.getResponseHeader.sessi
Ïà¹ØÎĵµ£º
Èí»Ø³µ£¨Soft Return£©£ºÈí»Ø³µÊÇÔÚ×Ö´¦Àí³ÌÐòÖÐ×÷Ϊ×Ô¶¯ÒÆÐй¦ÄܵÄÒ»²¿·Ö×Ô¶¯²åÈëµÄ£¬Ò²½Ð»»Ðзû£¬ÔÚwordÖп´²»¼û¡£Èç¹ûÎı¾
Ò»Ðеij¤¶È³¬¹ýÎĵµËù¶¨ÒåµÄÓұ߾àʱ£¬¼´µ±Ç°ÐÐûÓÐ×ã¹»µÄ¿Õ¼ä·ÅÖÃÏÂÒ»¸ö×Ö·ûʱ£¬ÎÄ×Ö´¦ÀíÈí¼þ½«ÔÚÕâÒ»ÐÐÎı¾µÄĩβ×Ô¶¯²åÈëÒ»
¸öÈí»Ø³µ·û£¬Îı¾ÁíÆðÒ»ÐС£Õâ¸öÈí»Ø³µ·ûÊÇÓɱ༳ÌÐò×Ô¶¯² ......
×î½ü×ö¸öÏîÄ¿£¬¾ÍÊÇҪȡµÃcpuÕ¼ÓÐÂʵȵȵÄϵͳÐÅÏ¢£¬Ò»¿ªÊ¼ÒÔΪҪÓö¯Ì¬Á´½Ó¿âÁË£¬µ«ºóÀ´·¢ÏÖ¿ÉÒÔÏñÏÂÃæÕâÑù×ö£¬²»È¥µ÷ÓÃjni£¬ÕâÑùÊ¡È¥Á˺ܶ࿴м¼ÊõµÄʱ¼äo(∩_∩)o...
ÔÚJavaÖУ¬¿ÉÒÔ»ñµÃ×ܵÄÎïÀíÄڴ桢ʣÓàµÄÎïÀíÄÚ´æ¡¢ÒÑʹÓõÄÎïÀíÄÚ´æµÈÐÅÏ¢£¬ÏÂÃæÀý×Ó¿ÉÒÔÈ¡µÃÕâЩÐÅÏ¢£¬²¢ÇÒ»ñµÃÔÚWindowsϵÄÄÚ´æʹÓà......
·ºÐÍÉùÃ÷¾ÍÊÇ·º·ºµÄÉùÃ÷ÀàÐÍ¡£ÎÒÃÇÓÃÆäËüµÄÓïÑÔ×öÒ»¸ö±È½Ï£º
JavascriptÉùÃ÷±äÁ¿£º var i= 1;var c = ‘char ’
VB ÉùÃ÷±äÁ¿£º dim i=1;dim c=’char’
Perl ÉùÃ÷±äÁ¿£º $i = 1; $c = ‘char’
ÕâЩ½Å±¾ÓïÑÔ£¬ÔÚÉùÃ÷±äÁ¿µÄʱºò£¬¸ù±¾¾Í²»ÏëjavaÄÇÑù»¹µÃÉùÃ÷ÀàÐÍ¡£ËûÃǵÄÀàÐÍÒÑ¾× ......
1.Ïà¹ØÀàµÄ½éÉÜ
·þÎñÆ÷³ÌÐò²»Í¬ÓÚ¿Í»§»ú¶ËµÄ³ÌÐò£¬ËüÐèÒª³õʼ»¯Ò»¸ö¶Ë¿Ú½øÐмàÌý£¬Óöµ½Á¬½Óºô½Ð£¬²ÅÓëÏàÓ¦µÄ¿Í»§»ú½¨Á¢Á¬½Ó¡£Java.net°üµÄServerSocketÀà°üº¬Á˱àд·þÎñÆ÷ϵͳµÄÈ«²¿ËùÐ蹦ÄÜ£¬¶ø¿Í»§¶ËÈí¼þͨ³£Ê¹ÓÃjava.net°üÖеĺËÐÄÀàSocketÓë·þÎñÆ÷µÄij¸ö¶Ë¿Ú½¨Á¢Á¬½Ó¡£
2.µ¥Ï߳̿ͻ§¶Ë³ÌÐò½¨Á¢²½Ö裺
1£©½¨Á¢socket£ ......
OpenJWeb(1.8) Java WebÓ¦ÓÿìËÙ¿ª·¢Æ½Ì¨µÄ×÷ÕßÊÇÎÒÃǼ¼ÊõÁªÃ˵ijÉÔ±£¬Ëû×î½üÍƳöÁËа汾µÄ¿ìËÙÓ¦Óÿª·¢Æ½Ì¨ OpenJWeb(1.8)£¬ÎÒ°ïËû×ö×öÐû´«
OpenJWeb¿ìËÙ¿ª·¢Æ½Ì¨ÒÔ¿ìËÙ¿ª·¢ÎªºËÐÄ£¬ÕûºÏÏȽøµÄjava
¿ªÔ´¿ò¼Ü£¬±¾×Å×ÔÖ÷¿ª·¢+Ó¦Óü¯³ÉÏà½áºÏµÄÔÔò£¬Ö¼ÔÚΪÕþ¸®¡¢ÆóÊÂÒµµ¥Î»¡¢Èí¼þ¹«Ë¾µÈƽ̨Óû§Ìṩһ ......