DWR can fix inside almost any framework. This website is a fairly extreme demonstration of this because it uses DWR inside Drupal (PHP).
DWR几几乎可以融合到任何框架,Drupal网站就是一个相当极致的范例
There are 2 levels at which DWR will work with Struts. The most basic level just involves using both at the same time, which is perfectly possible, but it does not allow you to share actions between DWR and Struts.
DWR和Struts一同工作的情况下,会有两个标准,最极尽可能的、基本的标准就是同时使用.但是这样的话就不允许你在DWR和Struts中分享使用Action了
DWR can call any method so there is nothing to stop you calling a Struts action from DWR, except that you don't want to do that. What would be the contents of the ActionForm? and what would DWR do with the returned ActionForward?
DWR可以调用任何方法,所以你同样也可以调用Struts的Action,除非你不想这样做。但是,ActionFrom的内容是什么?Action 转向后会做些什么?
A good approach is to refactor the Actions you wish to call so the logic is extracted from the Action. DWR and your Action then call the same method.
一个好方法就是重构你想要通过DWR调用的Action,将业务逻辑从Action中萃取出来,这样你就可以调用相同的方法了
个人看法:这些说整合Struts和DWR的话的有点牵强,即然要调用Action就得把相同的逻辑萃取出来重建类,那还称什么与Struts整合。最简单一点,DWR即然是Ajax框架,肯定是力图实现页面的无刷新,而Struts却正好讲究的是分发请求,肯定会刷新页面,两者矛盾,所以,不整合也bagong.两者可以用在同一系统中,只是各干各的就完了.
有同感
引用 :http://blog.sina.com.cn/s/blog_5cd425120100b0uw.html
DWR几几乎可以融合到任何框架,Drupal网站就是一个相当极致的范例
There are 2 levels at which DWR will work with Struts. The most basic level just involves using both at the same time, which is perfectly possible, but it does not allow you to share actions between DWR and Struts.
DWR和Struts一同工作的情况下,会有两个标准,最极尽可能的、基本的标准就是同时使用.但是这样的话就不允许你在DWR和Struts中分享使用Action了
DWR can call any method so there is nothing to stop you calling a Struts action from DWR, except that you don't want to do that. What would be the contents of the ActionForm? and what would DWR do with the returned ActionForward?
DWR可以调用任何方法,所以你同样也可以调用Struts的Action,除非你不想这样做。但是,ActionFrom的内容是什么?Action 转向后会做些什么?
A good approach is to refactor the Actions you wish to call so the logic is extracted from the Action. DWR and your Action then call the same method.
一个好方法就是重构你想要通过DWR调用的Action,将业务逻辑从Action中萃取出来,这样你就可以调用相同的方法了
个人看法:这些说整合Struts和DWR的话的有点牵强,即然要调用Action就得把相同的逻辑萃取出来重建类,那还称什么与Struts整合。最简单一点,DWR即然是Ajax框架,肯定是力图实现页面的无刷新,而Struts却正好讲究的是分发请求,肯定会刷新页面,两者矛盾,所以,不整合也bagong.两者可以用在同一系统中,只是各干各的就完了.
有同感
引用 :http://blog.sina.com.cn/s/blog_5cd425120100b0uw.html