Java Web¿ª·¢Ñ§Ï°±Ê¼ÇÖ®¶þ
1. doGet vs doPost
Õâ¸öÎÊÌ⣬ÀÏʦ½²µÃ²»ÊǺÜÇåÎú£¬½ö½ö½²ÁËdoGetÊÇ¿ÉÒÔÈ¡³ö²ÎÊýÖµÔÚurlÖеIJÎÊý¡£ÒÔÏÂÄÚÈÝcopy×ÔÍøÂ磺
“getÖ»ÓÐÒ»¸öÁ÷£¬²ÎÊý¸½¼ÓÔÚurlºó£¬µØÖ·ÐÐÏÔʾҪ´«Ë͵ÄÐÅÏ¢£¬´óС¸öÊýÓÐÑϸñÏÞÖÆÇÒÖ»ÄÜÊÇ×Ö·û´®¡£
postµÄ²ÎÊýÊÇͨ¹ýÁíÍâµÄÁ÷´«µÝµÄ£¬ ²»Í¨¹ýurl£¬ËùÒÔ¿ÉÒԺܴó£¬Ò²¿ÉÒÔ´«µÝ¶þ½øÖÆÊý¾Ý£¬ÈçÎļþµÄÉÏ´«¡£
1¡¢°²È«
GETµ÷ÓÃÔÚURLÀïÏÔʾÕý´«Ë͸øSERVLETµÄÊý¾Ý£¬ÕâÔÚϵͳµÄ°²È«·½Ãæ¿ÉÄÜ´øÀ´ÎÊÌ⣬ÀýÈçÓû§ÃûºÍÃÜÂëµÈ
POST¾Í¿ÉÒÔÔÚÒ»¶¨³Ì¶ÈÉϽâ¾ö´ËÀàÎÊÌâ
2¡¢·þÎñÆ÷½ÓÊÕ·½Ê½
·þÎñÆ÷Ëæ»ú½ÓÊÜGET·½·¨µÄÊý¾Ý£¬Ò»µ©¶ÏµçµÈÔÒò£¬·þÎñÆ÷Ò²²»ÖªµÀÐÅÏ¢ÊÇ·ñ·¢ËÍÍê±Ï
¶øPOST·½·¨£¬·þÎñÆ÷ÏȽÓÊÜÊý¾ÝÐÅÏ¢µÄ³¤¶È£¬È»ºóÔÙ½ÓÊÜÊý¾Ý
3¡¢formÔËÐз½Ê½
µ±form¿òÀïÃæµÄmethodΪgetʱ£¬Ö´ÐÐdoGet·½·¨
µ±form¿òÀïÃæµÄmethodΪpostʱ£¬Ö´ÐÐdoPost·½·¨
4¡¢ÈÝÁ¿ÏÞÖÆ
GET·½·¨ºóÃæµÄÐÅÏ¢Á¿×Ö½Ú´óС²»Òª³¬¹ý1.3K£¬¶øPostÔòûÓÐÏÞÖÆ
¿ÉÒÔÓÃservice()À´ÊµÏÖ£¬Ëü°üº¬ÁËdoGetºÍdoPost(×¢Òâ´Ë´¦£¬²»ÊÇdoGetºÍdoPost±»service·½·¨µ÷ÓÃ
)£»·½·¨ÊǽӿÚÖеķ½·¨£¬servletÈÝÆ÷°ÑËùÓÐÇëÇó·¢Ë͵½¸Ã·½·¨£¬¸Ã·½·¨Ä¬ÈÏÐÐΪÊÇת·¢httpÇëÇóµ½doXXX·½·¨ÖУ¬Èç¹ûÄãÖØÔØÁ˸÷½·¨£¬Ä¬ÈϲÙ×÷±»¸²¸Ç£¬²»ÔÙ½øÐÐת·¢²Ù×÷£¡
service()ÊÇÔÚjavax.servlet.Servlet½Ó¿ÚÖж¨ÒåµÄ, ÔÚjavax.servlet.GenericServletÖÐʵÏÖÁËÕâ¸ö½Ó¿Ú, ¶ø doGet/doPost ÔòÊÇÔÚ javax.servlet.http.HttpServlet
ÖÐʵÏÖµÄ, javax.servlet.http.HttpServlet ÊÇ
javax.servlet.GenericServlet µÄ×ÓÀà.
ËùÓпÉÒÔÕâÑùÀí½â,
ÆäʵËùÓеÄÇëÇó¾ùÊ×ÏÈÓÉ service() ½øÐд¦Àí, ¶øÔÚ javax.servlet.http.HttpServlet
µÄ service() ·½·¨ÖÐ, Ö÷Òª×öµÄÊÂÇé¾ÍÊÇÅжÏÇëÇóÀàÐÍÊÇ Get »¹ÊÇ Post, È»ºóµ÷ÓöÔÓ¦µÄ
doGet/doPost Ö´ÐÐ.”
2.Cookie vs Session
What is cookie:
1) It is essentially a piece of txt sent to the client from server
2) The client can prevent the server from writing cookie
3) A server can only get the cookie of itself
 
Ïà¹ØÎĵµ£º
/*
* @(#)MemoryMonitor.java 1.3 05/11/17
*
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are ......
ÎÒ½ñÌìѧϰÁËOracleÊý¾Ý¿âÈçºÎÐ޸ıíµÄ֪ʶ£¬ÊÇ·ëÍþÀÏʦ½²µÄ¿Î£¬ÎÒ×öÁ˼òµ¥µÄ¼Ç¼£º
1.ÔÚ±íÖвåÈëеÄÁУº
alter table tablename
add city varchar£¨2£© default 'rr' //¸³Ä¬ÈÏÖµ
2.Ð޸ıíÖеÄÁУº
alter table tablename
modify city varchar£¨20£©
3.ɾ³ý±íÖеÄÁУº
alter t ......
±¾×÷Æ·²ÉÓÃ֪ʶ¹²ÏíÊðÃû-·ÇÉÌÒµÐÔʹÓÃ-Ïàͬ·½Ê½¹²Ïí 2.5 Öйú´ó½Ðí¿ÉÐÒé½øÐÐÐí¿É¡£
JavaÖеıäÁ¿Óë¶ÔÏóÓÐÇø±ðÂð£¿
Òý×Ó£º±äÁ¿Óë¶ÔÏó
±äÁ¿ÊÇJavaÖÐ×î»ù±¾µÄ´æ´¢µ¥Ôª£¬Îª±äÁ¿¸³Öµ¿ÉÒÔʹÓø³Öµ±í´ïʽ¡£È磺
int i = 10;
¸Ã±í´ïʽµÄº¬ÒåÊǽ«Ò»¸ö×ÖÃæÁ¿£¨literal£©10¸³Öµ¸øÒ»¸öÀàÐÍΪintÐ͵ıäÁ¿£¬±äÁ¿ÃûΪi¡£ÕâÊÇÒ»¸öÎ ......
ÐÅÏ¢À´Ô´£ºÐ°¶ñ°Ë½øÖÆÐÅÏ¢°²È«ÍŶӣ¨www.eviloctal.com£©
Author:kj021320
×ªÔØÇë×¢Ãû³ö´¦¡£
JavaÓ¦ÓóÌÐò»·¾³µÄ°²È«²ßÂÔ£¬Ïêϸ˵Ã÷Á˶ÔÓÚ²»Í¬µÄ´úÂëËùÓµÓеIJ»Í¬×ÊÔ´µÄÐí¿É£¬ËüÓÉÒ»¸öPolicy¶ÔÏóÀ´±í´ï¡£
ΪÁËÈÃapplet£¨»òÕßÔËÐÐÔÚSecurityManagerϵÄÒ»¸öÓ¦ÓóÌÐò£©Äܹ»Ö´ÐÐÊܱ£»¤µÄÐÐΪ£¬ÀýÈç¶ÁдÎļþ£¬applet£¨»òJav ......
/* ¸ßÊÖÖ®×÷£¬±¾È˽÷ÒÔÊÕ²ØÕßÉí·Ý¹²ÏíÔ´Â룬¹©´ó¼Ò²Î¿¼Ö®! */
/*
* ÁбíADT½Ó¿Ú
*/
package dsa;
public interface List {
//²éѯÁÐ±íµ±Ç°µÄ¹æÄ£
public int getSize();
//ÅжÏÁбíÊÇ·ñΪ¿Õ
public boolean isEmpty();
//·µ»ØµÚÒ»¸öÔªËØ£¨µÄλÖã©
public Position first();
//· ......