AJAX¿ò¼Ü DWR ¼òµ¥ÅäÖÃ
¼òµ¥µÄÃèÊöÏ DWR ÅäÖ㨱£ÃÜÐÒ飬Ôڴ˲»¹«¿ªÏîÄ¿Ãû³Æ£¬ÏîÄ¿Ïà¹ØÃû³ÆÈ«²¿ÓÃXXXX´úÌ棩
Ê×ÏÈ ·Ï»°²»ËµÁË ´ó¼Ò¶¼Ó¦¸ÃÀí½âDWRµÄÓô¦ ²»¶®µÄÈ¥°Ù¶È
±ØÒª°ü DWR.JAR ¹Ù·½ÏÂÔصØÖ·http://directwebremoting.org/dwr/download.html
Õâ¸öÏîÄ¿ÊÇÓÉ SSH+dwr+jquery+sitemesh+freemarker
WEB.XML
<!-- dwr -->
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
DWR.XML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://www.getahead.ltd.uk/dwr/dwr20.dtd">
<dwr>
<allow>
<convert converter="bean" match="com.xxxx.xxxx.entity.Payment">
<param name="include" value="id,city,ems,express,surface" />
</convert>
<create creator="spring" javascript="allDWR">
<param name="beanName" value="allDWR"/>
<include method="paymentSearch"/>
</create>
</allow >
</dwr>
ÔÚÕâÀï½âÊÍÏ ÕâÖ»ÊǸö²âÊÔDWR ËùÒÔ²¢Ã»ÓÐ×ö¹ý¶àµÄÅäÖÃ
convert ÉùÃ÷Ò»¸öBEANºÃ×ö´«Öµ´¦Àí
create ½¨Á¢Ò»¸öÓÉSPRING¹ÜÀíµÄ DWRÀà
¹«¿ª·½·¨ paymentSearch
JSÒýÓÃ allDWR
spring BEANÃû³Æ allDWR
applicationContext.xml
<bean id="allDWR" class="com.xxxx.dwr.AllDwr" >
<property name="sessionFactory" ref="sessionFactory" />
</bean>
×¢ÈësessionFactory ALLDWR Õâ¸öÀàÓÃÓÚ×öÊý¾Ý¿â²Ù×÷
JSP
<mce:script type="text/javascript" src="<%=request.getContextPath()%><!--
/dwr/engine.js">
// --></mce:script>
<mce:script type="text/javascript" src="<%=
Ïà¹ØÎĵµ£º
Ò» .ÏÂÃæÏȶÔasp.net ajax×öÒ»¸ö¼òµ¥µÄ½éÉÜ:
asp.net ajax µÄ Ç°Éí¾ÍÊÇÎÒÃÇ´ó¼ÒÊìϤµÄAtlas £¬ºóÀ´±»ÕýʽµÄÄÉÈëµ½vs¿ò¼ÜÖÐÀ´¡£Í¨¹ý¶Ôasp.net ajaxµÄÓ¦Óà £¬ÎÒÃÇ¿ÉÒÔ·½±ãµÄ½«ajaxµÄÌØÐÔÒýÈëµ½ÏîÄ¿ÖÐÀ´£¬ÏÔÖøµÄÌá¸ßÓû§ÌåÑé¡£Æäʵasp.net ajaxµÄÌصãÒ²ÊǼ̳ÐÁË΢Èí²úÆ·Ò»¹áµÄÌص㣬¼òµ¥Ò×Ó᣹¦ÄÜÇ¿´ó¡£Ö»ÐèÒªÕÆÎÕasp ......
·þÎñÆ÷¶ËÏìÓ¦Îļþread_faq.jsp
·þÎñÆ÷ÏìÓ¦Îļþ¸ù¾ÝÓû§´«ÈëµÄfaqId²ÎÊý£¬´ÓÊý¾Ý¿âÖвéÕÒ¶ÔÓ¦µÄFAQÏêϸÐÅÏ¢¡£ÏêϸÐÅÏ¢¿ÉÒÔΪ°üº¬HTML±ê¼ÇµÄÄÚÈÝ¡£²éѯÍê±Ïºó½«½á¹û·µ»Ø¡£
<%@ page contentType="text/plain; charset=UTF-8"%>
<%@ page language="java"%>
<%@ page import="java.sql.*,ajax.db.D ......
Óû§²Ù×÷½çÃæpostalcode.html
Ò³ÃæÖаüº¬3¸öÎı¾¿ò£¬·Ö±ð±íʾÓÊÕþ±àÂë¡¢µØÇøºÍ³ÇÊÐÐÅÏ¢¡£µ±Óû§ÊäÈëÓÊÕþ±àÂëºó£¬ÏµÍ³½«×Ô¶¯´Ó·þÎñÆ÷¶ÁÈ¡µØÇøºÍ³ÇÊÐÐÅÏ¢£¬Ìî³äµ½¶ÔÓ¦Îı¾¿òÖС£ÏêϸµÄº¯Êý˵Ã÷Çë²Î¿¼´úÂëÖеÄ×¢ÊÍ¡£
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<tit ......
Ê÷ÐÎÁÐ±í£¨²Ëµ¥£©ÔÚWebÓ¦ÓÃÖÐÊ®·Ö³£¼û£¬Í¨³£Ó¦ÓÃÓÚĿ¼ʽ½á¹¹£¬ÀýÈç²úÆ··ÖÀà¡¢²¿ÃÅ»ú¹¹µÈ¡£´«Í³µÄÊ÷Ðβ˵¥Ö÷ÒªÓÐÁ½ÖÖ¼ÓÔØ·½Ê½£ºÒ»ÖÖÊÇÒ»´ÎÐÔ¼ÓÔØÈ«²¿Êý¾Ý£¬ÁíÒ»ÖÖÊǸù¾ÝÓû§²Ù×÷Öð²½¼ÓÔØÊý¾Ý£¬µ«ÊÇÐèҪˢÐÂÒ³Ã档ǰÕß¼ÓÔØËٶȽÏÂý£¬²¢ÇÒ´æÔÚ´óÁ¿Êý¾ÝûÓб»Ê¹ÓõÄÀË·ÑÇéÐΡ£ºóÕß¿ÉÒÔÖð²½¼ÓÔØ£¬µ«ÊÇƵ·±µØË¢ÐÂÒ³ÃæÔÚ¸øÓû§´øÀ ......
¼¼ÊõÒªµã
ÔÚ»ù±¾ÔÀíµÄ½éÉÜÖУ¬Á˽⵽ͨ¹ýÔÚ¸¸½ÚµãÄÚ¶¯Ì¬´´½¨×ӽڵ㣬²¢ÀûÓÃÑùʽ±íËõ½øÍê³ÉÊ÷ÐÎÁбíµÄ»ù±¾¿ò¼Ü¡£³ýÁËÕâÒ»µãÍ⣬»¹ÓÐÏÂÃæһЩÎÊÌâÐèÒª¿¼ÂÇ¡£
1£®½«¸¸½ÚµãËùÓеÄ×Ó½Úµã·ÅÈëÒ»¸öÈÝÆ÷ÖÐ
»ù±¾ÔÀíÒ³ÃæÖнö°üº¬ÁË´´½¨×Ó½ÚµãµÄ¹¦ÄÜ£¬²»¿ÉÒÔ½«´´½¨ºÃµÄ½ÚµãÔÙ½øÐйرղÙ×÷¡£Êµ¼ÊÓ¦ÓÃÖв˵¥×ÜÊÇ°üº¬´ò¿ªºÍ¹Ø±ÕÁ½ÖÖ² ......