DWRÖÐJava·½·¨µÄ²ÎÊý¼°·µ»ØÖµÉÏƪ
DWRÊÇÒ»¸ö¿ò¼Ü£¬¼òµ¥µÄ˵¾ÍÊÇÄܹ»ÔÚjavascriptÖ±½Óµ÷ÓÃjava·½·¨£¬¶ø²»±Øȥдһ´ó¶ÑµÄjavascript´úÂë¡£ËüµÄʵÏÖÊÇ»ùÓÚajaxµÄ£¬¿ÉÒÔʵÏÖÎÞË¢ÐÂЧ¹û¡£
ÍøÉÏÓв»ÉÙDWRµÄÀý×Ó£¬µ«´ó¶¼Ö»ÊÇijÖÖ·½·¨µÄµ÷Ó㬱¾ÎÄÖ»ÔÚʹÓòãÃæÉϽéÉÜDWR£¬²¢²»Éæ¸ü¶àµÄ¼¼ÊõÓëÉè¼Æ£¬ÆäÄ¿µÄÊÇÈóõѧÕßÄܹ»ºÜ¿ìµÄѧ»á¸÷ÖÖjava·½·¨ÔÚjavascriptÖÐÊÇÈçºÎµ÷Óõġ£
±¾ÎÄÒÔDWR 1.1 Ϊ»ù´¡£¬¶ÔÓÚDWR 2.0£¬ÒòΪ»¹Ã»ÓÐÕýʽ·¢²¼°æ£¬¹Ê²»×ö½éÉÜ¡£
Ò»¡¢DWRÅäÖÃƪ֮web.xml
1 ¡¢×îСÅäÖÃ
Xml´úÂë
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
2¡¢µ±ÎÒÃÇÏë¿´DWR×Ô¶¯Éú³ÉµÄ²âÊÔÒ³£¨Using debug/test mode£©Ê±£¬¿ÉÔÚservletÅäÖÃÖмÓÉÏ
Xml´úÂë
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
Õâ¸ö²ÎÊýDWRĬÈÏÊÇfalse¡£Èç¹ûÑ¡Ôñtrue£¬ÎÒÃÇ¿ÉÒÔͨ¹ýhttp://localhost:port/app/dwr ¿´µ½Ä㲿ÊðµÄÿ¸öDWR class¡£²¢ÇÒ¿ÉÒÔ²âÊÔjava´úÂëµÄÿ¸ö·½·¨ÊÇ·ñÔËÐÐÕý³£¡£ÎªÁË°²È«¿¼ÂÇ£¬ÔÚÕýʽ»·¾³ÏÂÄãÒ»¶¨°ÑÕâ¸ö²ÎÊýÉèΪfalse¡£
3¡¢¶à¸ödwr.xmlÎļþµÄÅäÖÃ
¿ÉÄÜÓм¸ÖÖÇé¿ö£¬ÎÒÃÇÒ»Ò»Áо١£Ò»¸öservlet£¬¶à¸ödwr.xmlÅäÖÃÎļþ£»¶à¸öservlet£¬Ã¿¸öservlet¶ÔÓ¦Ò»¸ö»ò¶à¸ödwr.xmlÅäÖ
Ïà¹ØÎĵµ£º
×î½ü¿´µ½Ò»¸öÓÐÒâ˼µÄÊ÷Ðνṹ£¬ÎªÃ¿¸ö½ÚµãÌí¼ÓÁËlft
ºÍ
rgt
Á½¸öÊôÐÔ¡£ÕâÑù²éÕҸýڵãµÄ×ӽڵ㡢
²éÕҸýڵãËùÓи¸½Úµã£¬¾Í²»ÓÃÈ¥µÝ¹é²éѯ£¬Ö»ÐèÒªÓÃ
between
¡¢
and
Óï¾ä¾Í¿ÉÒÔʵÏÖ¡£ÏÂÃæÒÔ´´½¨Ò»¸öÀ¸Ä¿Ê÷ΪÀý£¬ÒÔÏÂÊÇÎÒµÄÀí½â¡£
¡¡¡¡Ò»°ãÀ´½²£¬ÎÒÃÇ´´½¨À¸Ä¿Ê÷µÄʱºò£¬´ó¶àÖ»ÐèÒªÒ»¸öÍâ¼üparentid
À´Çø·Ö¸Ã½Úµã ......
1.½«Int,Float,Double,Longת»»ÎªString
String s = ""+i;
String s = String.valueOf(i);
String s = Integer.toString(i);
µÚÒ»ÖÖ·½·¨£ºs = ""+i; //»á²úÉúÁ½¸öString¶ÔÏó
µÚ¶þÖÖ·½·¨£ºs=String.valueOf(i); //Ö±½ÓʹÓÃStringÀàµÄ¾²Ì¬·½·¨£¬Ö»²úÉúÒ»¸ö¶ÔÏó
µÚÈýÖÖ·½·¨£ºÐ§ÂÊ×î¸ß£¿
2.½«Stringת»»ÎªIn ......
abstract classºÍinterfaceÊÇJavaÓïÑÔÖжÔÓÚ³éÏóÀඨÒå½øÐÐÖ§³ÖµÄÁ½ÖÖ»úÖÆ£¬ÕýÊÇÓÉÓÚÕâÁ½ÖÖ»úÖƵĴæÔÚ£¬²Å¸³ÓèÁËJavaÇ¿´óµÄÃæÏò¶ÔÏóÄÜÁ¦¡£ abstract classºÍinterfaceÖ®¼äÔÚ¶ÔÓÚ³éÏóÀඨÒåµÄÖ§³Ö·½Ãæ¾ßÓкܴóµÄÏàËÆÐÔ£¬ÉõÖÁ¿ÉÒÔÏ໥Ìæ»»£¬Òò´ËºÜ¶à¿ª·¢ÕßÔÚ½øÐгéÏóÀඨÒåʱ¶ÔÓÚ abstract cl ......
ÔÚJava
ÓïÑÔÖУ¬ abstract class ºÍinterface
ÊÇÖ§³Ö³éÏóÀà
¶¨
ÒåµÄÁ½ÖÖ»úÖÆ¡£ÕýÊÇÓÉÓÚÕâÁ½ÖÖ»úÖƵĴæÔÚ£¬²Å¸³ÓèÁËJavaÇ¿´óµÄ ÃæÏò¶ÔÏóÄÜÁ¦¡£abstract
classºÍinterfaceÖ®¼äÔÚ¶ÔÓÚ³éÏóÀඨÒåµÄÖ§³Ö·½Ãæ¾ßÓкܴóµÄÏàËÆÐÔ£¬ÉõÖÁ¿ÉÒÔÏ໥Ìæ»»£¬Òò´ËºÜ¶à¿ª·¢ÕßÔÚ½ø
ÐгéÏóÀඨÒåʱ¶ÔÓÚabstract
classºÍinterfaceµÄÑ¡Ô ......
ÔÚJavaÖУ¬¶¨Ò庯Êý»òÕß±äÁ¿µÄʱºò£¬¶Ôº¯Êý¡¢±äÁ¿¶¼ÓÐÒ»¸ö·ÃÎÊȨÏÞÎÊÌâ¡£
¶ÔÓÚº¯ÊýÀ´Ëµ£¬±ÈÈ磺
public class test {
public static void main(String[] args) {
// TODO Auto-generated method stub
}
public void apublic() {
//public º¯Êý
}
pri ......