ajax dwr(direct web remoting)框架简介
这个从JAVA到JavaScript的远程功能方法给DWR的用户带来非常像传统的RPC机制,就像RMI或者SOAP一样,而且拥有运行在WEB上但是不需要浏览器插件的好处.
它包含两个主要的部分:允许JavaScript从WEB服务器上一个遵循了AJAX原则的Servlet(小应用程序)中获取数据.另外一方面一个JavaScript库可以帮助网站开发人员轻松地利用获取的数据来动态改变网页的内容.
http://flyfish81225.blogchina.com/4098286.html http://getahead.ltd.uk/dwr/getstartedhttp://getahead.ltd.uk/dwr/getstarteddwr.xml
<!DOCTYPE dwr PUBLIC
"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
<dwr>
<allow>
<create creator="new" javascript="JDate">
<param name="class" value="java.util.Date"/>
</create>
<create creator="new" javascript="Demo">
<param name="class" value="your.java.Bean"/>
</create>
</allow>
</dwr>
defines what classes DWR can create and remote for use by Javascript
Bean类必须都有一个默认的无参构造器
DWR has a few restrictions:
- Avoid reserved JavaScript words
- Methods named after reserved words are automatically excluded. Most JavaScript reserved words are also Java reserved words, so you won't be having a method called "try()" anyway. However the most common gotcha is "delete()", which has special meaning from JavaScript but not Java.
- Overloaded methods can be involved in a bit of a lottery as to which gets called, so avoid overloaded methods.
posted on 2006-05-19 17:22
简易 阅读(208)
评论(0) 编辑 收藏