简体   繁体   English

有关AJAX库(如DWR)的问题

[英]Question on AJAX Library (like DWR)

I have a web app which uses AJAX library (DWR) to get data dynamically ie as user clicks on some table items, it dynamically gets details for that item by making a DWR call...It actually gets the complete HTML code as string for the table (Actually in the background, a Java method does the processing and returns the HTML string)...So the usage is like this; 我有一个Web应用程序,它使用AJAX库(DWR)动态获取数据,即当用户单击某些表项时,它通过调用DWR动态地获取该项的详细信息...实际上它获取完整的HTML代码作为字符串表(实际上是在后台,一个Java方法进行处理并返回HTML字符串)...因此用法如下:

someDWRObj.someJavaMethod(someData,callBackFunction);

I am sure MOST of you would say that this is NOT at all a GOOD practice.. 我敢肯定,你们中的大多数会说这根本不是一种好的做法。

So my question is, is DWR an outdated technology, what are the replacements for DWR technology (more specifically to implement what i am trying to do above) ? 所以我的问题是,DWR是一种过时的技术吗,DWR技术的替代品是什么(更具体地讲,是我要实现的目标)? Can DOJO do what DWR does ? DOJO可以做DWR吗?

All the questions assume that I'll be using Java in the middle tier.. 所有问题都假设我将在中间层使用Java。

Thank you. 谢谢。

If you are writing if from scratch again then you could consider some existing frameworks like GWT or Vaadin. 如果您是从头开始编写,那么可以考虑使用一些现有的框架,例如GWT或Vaadin。 If not, then I guess you could just use a REST web services on the server side exposing your existing functionality using REST with JSON objects and on the client side (html page) you can parse JSON data with JQuery to suit your needs. 如果没有,那么我想您可以只在服务器端使用REST Web服务,以使用带有JSON对象的REST来公开您现有的功能,而在客户端(html页面)上,您可以使用JQuery解析JSON数据来满足您的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM