我有一些在服务器上运行的 GWT 应用程序。
我们正在使用一些解决方案来订阅该应用程序,该解决方案会定期对这个应用程序执行 ping 操作。
关键是,该解决方案(服务)检查服务器返回的响应是否包含一些预定义的关键字。
但如您所知,GWT 返回纯空 HTML 页面,其中包含 .js 文件中的数据。
那么,Ping 服务将无法检查预定义的关键字,这个说法是真的吗?
如果这是真的,我们就不能找到任何解决方案来解决这个问题吗?
谢谢。
I have some GWT application that run on the server.
we are subscripting with some solution that pings this application in a regular interval of time.
The point is, this solution (service) checks the returned response from the server to contain some pre-defined keywords.
But as you know, GWT return plain empty HTML page with the data contained in the .js file.
So, the Ping service will not be able to exmain the pre-defined keywords, Is this statement true??
And if this is ture, cannot we find any workaround solution to solve such problem?
Thanks.
发布评论
评论(2)
您遇到的问题与 AJAX 应用程序的抓取能力有关 - Google 有一些为您提供指针:)通常,您需要服务器上有一个无头浏览器来生成您通常在浏览器中看到的输出,例如参见 HtmlUnit。
The problem you are facing is related to the crawlabitlity of AJAX applications - Google has some pointers for you :) Generally, you need a headless browser on the server to generate the output you'd normally see in the browser, for example see HtmlUnit.
只有初始容器页面及其嵌入的加载器脚本是 HTML 和 HTML 格式。 JS。然后,您可以使用 GWT 的 RPC 机制与服务器交换 Java 对象,或者使用 Ajax(例如 RequestBuilder)与服务器交换任何类型的数据。您可以命名它:JSON、XML、纯文本等。
Only the initial container page and the loader script that it embeds are HTML & JS. Afterwards, you use GWT's RPC mechanism to exchange Java objects with the server, or Ajax (eg. RequestBuilder) to exchange any kind of data with the server. you name it: JSON, XML, plain text, etc.