Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JSPÖÐrequest¶ÔÏó¡¢session¶ÔÏó¡¢Cookie¶ÔÏóµÄʹÓÃ

¿ÉÒÔʹÓà Application ¶ÔÏóʹ¸ø¶¨Ó¦ÓóÌÐòµÄËùÓÐÓû§¹²ÏíÐÅÏ¢¡£
Request ¶ÔÏó
¿ÉÒÔʹÓà Request ¶ÔÏó·ÃÎÊÈκÎÓà HTTP ÇëÇ󴫵ݵÄÐÅÏ¢£¬°üÀ¨´Ó HTML ±í¸ñÓà POST ·½·¨»ò GET ·½·¨´«µÝµÄ²ÎÊý¡¢cookie ºÍÓû§ÈÏÖ¤¡£Request ¶ÔÏóʹÄúÄܹ»·ÃÎÊ·¢Ë͸ø·þÎñÆ÷µÄ¶þ½øÖÆÊý¾Ý£¬ÈçÉÏÔصÄÎļþ¡£
Response ¶ÔÏó
¿ÉÒÔʹÓà Response ¶ÔÏó¿ØÖÆ·¢Ë͸øÓû§µÄÐÅÏ¢¡£°üÀ¨Ö±½Ó·¢ËÍÐÅÏ¢¸øä¯ÀÀÆ÷¡¢Öض¨Ïòä¯ÀÀÆ÷µ½ÁíÒ»¸ö URL »òÉèÖà cookie µÄÖµ¡£
Server ¶ÔÏó
Server ¶ÔÏóÌṩ¶Ô·þÎñÆ÷Éϵķ½·¨ºÍÊôÐÔ½øÐеķÃÎÊ¡£×î³£Óõķ½·¨ÊÇ´´½¨ ActiveX ×é¼þµÄʵÀý (Server.CreateObject)¡£ÆäËû·½·¨ÓÃÓÚ½« URL »ò HTML ±àÂë³É×Ö·û´®£¬½«ÐéÄâ·¾¶Ó³Éäµ½ÎïÀí·¾¶ÒÔ¼°ÉèÖýű¾µÄ³¬Ê±ÆÚÏÞ¡£
Session ¶ÔÏó
¿ÉÒÔʹÓà Session ¶ÔÏó´æ´¢Ìض¨µÄÓû§»á»°ËùÐèµÄÐÅÏ¢¡£µ±Óû§ÔÚÓ¦ÓóÌÐòµÄÒ³Ö®¼äÌøתʱ£¬´æ´¢ÔÚ Session ¶ÔÏóÖеıäÁ¿²»»áÇå³ý£»¶øÓû§ÔÚÓ¦ÓóÌÐòÖзÃÎÊҳʱ£¬ÕâЩ±äÁ¿Ê¼ÖÕ´æÔÚ¡£Ò²¿ÉÒÔʹÓà Session ·½·¨ÏÔʽµØ½áÊøÒ»¸ö»á»°ºÍÉèÖÿÕÏлỰµÄ³¬Ê±ÆÚÏÞ¡£
ObjectContext ¶ÔÏó
¿ÉÒÔʹÓà ObjectContext ¶ÔÏóÌá½»»ò³·ÏûÓÉ ASP ½Å±¾³õʼ»¯µÄÊÂÎñ¡£ £­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­£­ request×÷ÓÃÓòÊÇÌá½»Ò³Ã棬¼òµ¥Ëµ¾ÍÊÇÒ³Ãæ¼ä´«µÝ¹¤¾ß£¬¿ÉÒÔÓÃ
request.getParameter("key")
(String)request.getAttribute("key")
sessionµÄ×÷ÓÃÓòÊǻỰ£¬¾ÍÊÇÔڻỰʱ¼äÄÚ¶¼ÓÐЧ£¬
(String)session.getAttribute("key")
sessionµÄʵÖÊÊÇ·þÎñÆ÷³ÌÐò½«sessionµÄ±äÁ¿´æÈëcookie CookieÓÃÓÚ±£´æ¿Í»§ä¯ÀÀÆ÷ÇëÇó·þÎñÆ÷Ò³ÃæµÄÇëÇóÐÅÏ¢£¬³ÌÐòÔ±Ò²¿ÉÒÔÓÃËü´æ·Å·ÇÃô¸ÐÐÔµÄÓû§ÐÅÏ¢£¬ÐÅÏ¢±£´æµÄʱ¼ä¿ÉÒÔ¸ù¾ÝÐèÒªÉèÖá£Èç¹ûûÓÐÉèÖÃCookieʧЧÈÕÆÚ£¬ËüÃǽö½ö±£´æµ½¹Ø±Õä¯ÀÀÆ÷³ÌÐòΪֹ¡£Èç¹û½«Cookie¶ÔÏóµÄExpiresÊôÐÔÉèÖÃΪMinValue£¬Ôò±íʾCookieÓÀÔ¶²»»á¹ýÆÚ¡£Cookie´æ´¢µÄÊý¾ÝÁ¿ºÜÊÜÏÞÖÆ£¬´ó¶àÊýä¯ÀÀÆ÷Ö§³Ö×î´óÈÝÁ¿Îª4096×Ö½Ú£¬Òò´Ë²»ÒªÓÃÀ´±£´æÊý¾Ý¼¯¼°ÆäËû´óÁ¿Êý¾Ý¡£ÓÉÓÚ²¢·ÇËùÓÐä¯ÀÀÆ÷¶¼Ö§³ÖCookie£¬²¢ÇÒÊý¾ÝÐÅÏ¢ÊÇÒÔÃ÷ÎÄÎı¾µÄÐÎʽ±£´æÔÚ¿Í»§¶ËµÄ¼ÆËã»úÖУ¬Òò´Ë×îºÃ²»Òª±£´æÃô¸ÐµÄ¡¢Î´¼ÓÃܵÄÊý¾Ý£¬·ñÔò»áÓ°ÏìÍøÕ¾µÄ°²È«ÐÔ¡£ ʹÓÃCookie¶ÔÏó±£´æºÍ¶ÁÈ¡ÐÅÏ¢µÄ´úÂëÈçÏ¡£ //´æ·ÅÐÅÏ¢
Response.Cookies[" nameID"].Value= " 0001"; //¶ÁÈ¡ÐÅÏ¢


Ïà¹ØÎĵµ£º

Java/JspÅäÖÃ

JAVAÅäÖãº
1£º JAVA_HOME £º  C:\Program Files\Java\jdk1.6.0_12
2£ºCLASSPATH £º    .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar
3£ºPATH £º              %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin
TomcatÅäÖ ......

JspÔËÐÐÔ­Àí

 
ÐèÒª¼ÇסµÄ֪ʶµã£º
1 ÇëÇóÓ¦´ðģʽ£¬¿Í»§¶Ë·¢ËÍÇëÇ󣬷þÎñÆ÷½øÐÐÏìÓ¦
2 JSPÎļþÊÇÔÚ·þÎñÆ÷¶ËÖ´ÐеÄ
3 ·µ»Ø¸ø¿Í»§¶ËµÄ½á¹ûÊÇJSPÎļþÖ´ÐеĽá¹û£¬²»°üº¬ÈκÎJSPÓï·¨
4 ÄÚ²¿¶ÔÏóÊÇÔÚ°ÑJSPÎļþת»»ÎªJava´úÂëµÄʱºòÉú³ÉµÄ
5 Ö´ÐеIJ¢²»ÊÇJSPÎļþ±¾Éí£¬¶øÊÇJSPת»»³ÉµÄJavaÀàµÄ¶ÔÏóµÄ·½·¨£¬ËùÒÔÓÐʱºòÐÞ¸ÄJSPÎļþ² ......

jsp,java±àÂëÔ­Àí

Îļþ´ò¿ªÊ±ºòÊÇͨ¹ýÎļþÍ·À´È·¶¨ÎļþµÄ±àÂë
StreamReader   sr=new   StreamReader(@"F:\cym\temp\1.txt");  
  sr.CurrentEncoding   //·µ»Ø±àÂë
ÊÀ½çÉϵĸ÷µØÇø¶¼Óб¾µØµÄÓïÑÔ¡£µØÇø²îÒìÖ±½Óµ¼ÖÂÁËÓïÑÔ»·¾³µÄ²îÒì¡£ÔÚ¿ª·¢Ò»¸ö¹ú¼Ê»¯³ÌÐòµÄ¹ý³ÌÖУ¬´¦ÀíÓïÑÔÎ ......

JSPÓëServletµÄÌøת¼°µÃµ½Â·¾¶·½·¨ÕûÀí

  ½ñÌìÕûÀíÏîÄ¿µÄÁ÷³Ì£¬ÔÚJSPºÍServletÖ®¼äÌøÀ´ÌøÈ¥£¬Ôø¾­Ò»¶Îʱ¼ä£¬ÎÒ¶¼ÊÇ°ÑServlet·¾¶¶¨ÒåΪ¡°/SomeServlet¡±£¬Ò²¼´¶¨ÒåΪ¸ùĿ¼£¬ÒòΪ¼æÈÝÐԱȽϺ㬵«ÊÇÓÃÁËMyEclipseÖ®ºó£¬Ð½¨µÄServletĬÈÏ·¾¶ÊÇ¡°/servlet/SomeServlet¡±£¬ÕâÑùд±ãÓÚ¹ÜÀí£¬ÁíÍâ¾ÍÊǸüÊʺϵ¥¶ÀΪServletÉèÖÃFilter£¨¹ØÓÚFilterµÄÉèÖÿÉÒԲο¼ ......

jbossƽ̨ÏÂjspÁ¬½Ósql2005ºÍsql2000

1¡¢ÅäÖÃjava»·¾³£¬MyEclipse7.0¡£ÅäÖÃjboss5.0£¬Õ¹¿ªÑ¡ÔñjdkΪÒÑ°²×°µÄjdk·¾¶¡£
2¡¢°²×°2005ºÍsql2000£¬×°2000ʱҪװsp4.Çý¶¯Ñ¡Ôñjdbc2.0¡£ÔÙ×°2000ʱʵÀýÃû×Ô¼ºÊäÈëÒ»¸ö¡£ÕâÀïµÄÎÊÌâ¾ÍÊǵǼÃûºÍÃÜÂëµÄÉèÖã¬ÓÒ»÷“SQL   Server×é”ϵÄʵÀýÃû£¨Windows   NT)"µÄ“ÊôÐÔ”£¬ÔÚµ¯³öµÄ¶Ô»°¿ò ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ