JavaÃæÊÔÌ⣨4£©
58¡¢Ï̵߳Ļù±¾¸ÅÄî¡¢Ï̵߳Ļù±¾×´Ì¬ÒÔ¼°×´Ì¬Ö®¼äµÄ¹Øϵ
¡¡¡¡Ïß³ÌÖ¸ÔÚ³ÌÐòÖ´Ðйý³ÌÖУ¬Äܹ»Ö´ÐгÌÐò´úÂëµÄÒ»¸öÖ´Ðе¥Î»£¬Ã¿¸ö³ÌÐòÖÁÉÙ¶¼ÓÐÒ»¸öỊ̈߳¬Ò²¾ÍÊdzÌÐò±¾Éí¡£
JavaÖеÄÏß³ÌÓÐËÄÖÖ״̬·Ö±ðÊÇ£ºÔËÐС¢¾ÍÐ÷¡¢¹ÒÆð¡¢½áÊø¡£
59¡¢JSPµÄ³£ÓÃÖ¸Áî
<%@page language="java" csession="true" buffer="64kb" autoFlush="true" isThreadSafe="true"info="text" errorPage="error.jsp" isErrorPage="true" isELIgnored="true"pageEncoding="gb2312" import="java.sql.*"%>
isErrorPage(ÊÇ·ñÄÜʹÓÃException¶ÔÏó)£¬isELIgnored(ÊÇ·ñºöÂÔ±í´ïʽ)
<%@include file="filename"%>
<%@taglib prefix="c"uri="http://......"%>
60¡¢Ê²Ã´Çé¿öϵ÷ÓÃdoGet()ºÍdoPost()£¿
¡¡¡¡JspÒ³ÃæÖеÄform±êÇ©ÀïµÄmethodÊôÐÔΪgetʱµ÷ÓÃdoGet()£¬Îªpostʱµ÷ÓÃdoPost()¡£
61¡¢servletµÄÉúÃüÖÜÆÚ
¡¡¡¡webÈÝÆ÷¼ÓÔØservlet£¬ÉúÃüÖÜÆÚ¿ªÊ¼¡£Í¨¹ýµ÷ÓÃservletµÄinit()·½·¨½øÐÐservletµÄ³õʼ»¯¡£Í¨¹ýµ÷ÓÃservice()·½·¨ÊµÏÖ£¬¸ù¾ÝÇëÇóµÄ²»Í¬µ÷Óò»Í¬µÄdo***()·½·¨¡£½áÊø·þÎñ£¬webÈÝÆ÷µ÷ÓÃservletµÄdestroy()·½·¨¡£
62¡¢ÈçºÎÏÖʵservletµÄµ¥Ïß³Ìģʽ
<%@ page isThreadSafe="false"%>
63¡¢Ò³Ãæ¼ä¶ÔÏ󴫵ݵķ½·¨
request£¬session£¬application£¬cookieµÈ
64¡¢JSPºÍServletÓÐÄÄЩÏàͬµãºÍ²»Í¬µã£¬ËûÃÇÖ®¼äµÄÁªÏµÊÇʲô£¿
¡¡¡¡JSPÊÇServlet¼¼ÊõµÄÀ©Õ¹£¬±¾ÖÊÉÏÊÇServletµÄ¼òÒ×·½Ê½£¬¸üÇ¿µ÷Ó¦ÓõÄÍâ±í±í´ï¡£JSP±àÒëºóÊÇ"Ààservlet"¡£ServletºÍJSP×îÖ÷ÒªµÄ²»Í¬µãÔÚÓÚ£¬ServletµÄÓ¦ÓÃÂß¼ÊÇÔÚJavaÎļþÖУ¬²¢ÇÒÍêÈ«´Ó±íʾ²ãÖеÄHTMLÀï·ÖÀ뿪À´¡£¶øJSPµÄÇé¿öÊÇJavaºÍHTML¿ÉÒÔ×éºÏ³ÉÒ»¸öÀ©Õ¹ÃûΪ.jspµÄÎļþ¡£JSP²àÖØÓÚÊÓͼ£¬ServletÖ÷ÒªÓÃÓÚ¿ØÖÆÂß¼¡£
65¡¢ËÄÖֻỰ¸ú×Ù¼¼Êõ
»á»°×÷ÓÃÓòServletsJSP Ò³ÃæÃèÊö
pageÊÇ´ú±íÓëÒ»¸öÒ³ÃæÏà¹ØµÄ¶ÔÏóºÍÊôÐÔ¡£Ò»¸öÒ³ÃæÓÉÒ»¸ö±àÒëºÃµÄ Java servlet Àࣨ¿ÉÒÔ´øÓÐÈÎºÎµÄ include Ö¸Áµ«ÊÇûÓÐ include ¶¯×÷£©±íʾ¡£Õâ¼È°üÀ¨ servlet ÓÖ°üÀ¨±»±àÒë³É servlet µÄ JSP Ò³Ãæ
requestÊÇÊÇ´ú±íÓë Web ¿Í»§»ú·¢³öµÄÒ»¸öÇëÇóÏà¹ØµÄ¶ÔÏóºÍÊôÐÔ¡£Ò»¸öÇëÇó¿ÉÄÜ¿çÔ½¶à¸öÒ³Ã棬Éæ¼°¶à¸ö Web ×é¼þ£¨ÓÉÓÚ forward Ö¸ÁîºÍ include ¶¯×÷µÄ¹Øϵ£©
sessionÊÇÊÇ´ú±íÓëÓÃÓÚij¸ö Web ¿Í»§»úµÄÒ»¸öÓû§ÌåÑéÏà¹ØµÄ¶ÔÏóºÍÊôÐÔ¡£Ò»¸ö Web »á»°¿ÉÒÔÒ²¾³£»á¿çÔ½¶à¸ö¿Í»§»úÇëÇó
applicationÊÇÊÇ´ú±íÓëÕû¸ö Web Ó¦ÓóÌÐòÏà¹ØµÄ¶ÔÏóºÍÊôÐÔ¡£
Ïà¹ØÎĵµ£º
1¡¢Java SE 7ÔâÓö.NET CLR»á·¢Éúʲô£¿
´ÓJava SE 7µÄ¹¦ÄÜÁбíÖпÉÒÔ¿´³ö£¬ËüÏà±ÈÒÔÇ°°æ±¾ÓÐÁ˳¤×ãÌá¸ß¡£ÄÇô£¬ËüÊÇÒ»¸öÓÎÏ·¸Ä±äÕßÂð£¿ÎÒÈÏΪ²»»áÊÇÕâÑù¡£ÔÚ¹ýÈ¥ÊýÄêÖУ¬JVMºÍ.NET CLR¶¼·¢ÉúÁËÖÚ¶à¸Ä½ø£»¹ýÈ¥ÄÇЩֻÓм¼Êõ·Ç³£¸ß³¬µÄ³ÌÐòÔ±²ÅÄÜÍê³ÉµÄÐí¶àÊÂÇ飬ÏÖÔÚ½èÖúÓÚJVMºÍ.NET CLRµÄÔöÇ¿¹¦ÄÜ£¬ÆÕͨ³ÌÐòÔ±Ò²Äܹ»×öµÃµ½¡ ......
ÓÐJAVAÖУ¬ÓÐʱºòÐèÒª¸ù¾ÝÌõ¼þÀ´Éú³ÉÅú´¦ÀísqlsÓï¾äµÈ£¬ÐèÒª¶¯Ì¬Éú³ÉÊý×é¡£·½·¨£º
List<String> list=new ArrayList<String>();
if(true){
list.add("insert.....");
list.add("update....");
}else{
list.add("insert....");
}
//Õâ¾äÊÇ¹Ø ......
JNBridgeÌṩÁË¿çÔ½JavaÓë.NET´úÂëµÄ·Ö²¼Ê½ÊÂÎñÖ§³Ö
×÷Õß Jonathan Allen ÒëÕß ÕÅÁú ·¢²¼ÓÚ 2009Äê12ÔÂ28ÈÕ ÉÏÎç5ʱ5·Ö
ÉçÇø .NET, Java Ö÷Ìâ »¥²Ù×÷, ÊÂÎñ´¦Àí ±êÇ© JNBridge
ƾ½èJNBridge¼¼Êõ£¬JavaºÍ.NET´úÂëÎÞÐè½»²æ±àÒëÆ÷¾Í¿ÉÒÔʵÏÖ¶ÔÏó¹²Ïí¡£ËùÓÐJava´úÂëÔËÐÐÔÚJVMÉÏ£¬¶ø.NET´úÂëÔòÔËÐÐÔÚCLRÉÏ¡£Ôڸ÷½°¸Ï£¬JVM ......
¡¡¡¡²»ÖªµÀÖ÷ÌâΪ"J2MEÖеÄÄÚ´æй©"ÊÇ·ñÍ×µ±£¬²»¹ýÔÚJ2MEÖÐÈç¹û´¦Àí²»ºÃ×ÊÔ´µÄ´´½¨ºÍÊÍ·ÅÎÊÌ⣬Ҳ»á³öÏÖÀàËÆÔÚC\C++ÖеÄÄÚ´æй©ÏÖÏó¡£
¡¡¡¡J2MEÖÐ×ʹÓõÄ×ÊÔ´ÎÞ·ÇÊÇͼƬºÍÉùÒô¡£ÎªÁËÌá¸ßÓÎÏ·µÄÔËÐÐËٶȣ¬ÎÒÃÇͨ³£°ÑËüÃÇÉùÃ÷Ϊȫ¾Ö±äÁ¿£¬ÓÖÓÉÓÚÊÖ»úµÄÄÚ´æµÄ¹Øϵ£¬ÎÒÃDz»ÄÜ°ÑÕâЩ×ÊԴͬʱ¼ÓÔؽøÄڴ棬ËùÒÔÎÒÃÇ»áÔÚÊ¹Ó ......
40¡¢¹¹ÔìÆ÷ConstructorÊÇ·ñ¿É±»override?
¡¡¹¹ÔìÆ÷Constructor²»Äܱ»¼Ì³Ð£¬Òò´Ë²»ÄÜÖØдOverriding£¬µ«¿ÉÒÔ±»ÖØÔØOverloading¡£
41¡¢ÊÇ·ñ¿ÉÒԼ̳ÐStringÀà?
¡¡¡¡StringÀàÊÇfinalÀà¹Ê²»¿ÉÒԼ̳С£
42¡¢swtichÊÇ·ñÄÜ×÷ÓÃÔÚbyteÉÏ£¬ÊÇ·ñÄÜ×÷ÓÃÔÚlongÉÏ£¬ÊÇ·ñÄÜ×÷ÓÃÔÚStringÉÏ?
¡¡¡¡switch£¨expr1£©ÖУ¬expr1ÊÇÒ»¸öÕûÊý±í´ ......