使用GWT后端但不使用前端 [英] Using GWT backend but not frontend
问题描述
我刚刚加入了GWT项目.
我们现在的目标是通过登录创建更多页面.
我想将这些页面添加为简单的HTML并使用现有的GWT后端.
这可能吗?
当我在当前登录页面中查看网络时,我看到GWT使用了一个长字符串,并用竖线连接起来,例如:
7|0|11|http://15.165.128.219:8099/welcome/|B080515AD1EBC13C065F38E72385F941|com.company.AdminService|login|com.company.LoginDetails/94248548|java.util.HashSet/3273092938|java.lang.String/2004016611|myusername|mypassword|1|2|3|4|1|5|5|P__________|6|1|7|8|6|1|7|9|10|11|
我知道JQuery Ajax
$.ajax( { username : "username" , password : "password" }
GWT响应如下:
//OK['C',[],0,7]
如何将两种技术结合在一起?使用GWT调度JQuery Ajax请求并进行回复的正确方法是什么?
在您编写自己的代码向之提出请求并解析GWT-RPC的响应时,您已经重写了相当一部分的GWT. /p>
您最好的选择是在客户端使用GWT处理服务器通信(然后将结果传递给jQuery),或者在服务器端编写类似servlet的内容,这是GWT的备用接口- RPC调用.
但是,如果您坚持走这条路,那么开始的地方是这个问题: GWT RPC数据格式
所选答案会链接该格式的基本概述的来源.对于完整的细节,尽管别无选择,只能深入研究源头.该协议在其他任何地方都没有完整记录.
I just joined a GWT project.
Our goal now is to create more pages with login.
I would like to add these pages as simple HTML and use the existing GWT backend.
Is this possible?
When I look at the network in the current login page, I see GWT uses a long string concatenated with vertical bars, something like :
7|0|11|http://15.165.128.219:8099/welcome/|B080515AD1EBC13C065F38E72385F941|com.company.AdminService|login|com.company.LoginDetails/94248548|java.util.HashSet/3273092938|java.lang.String/2004016611|myusername|mypassword|1|2|3|4|1|5|5|P__________|6|1|7|8|6|1|7|9|10|11|
And I know JQuery Ajax
$.ajax( { username : "username" , password : "password" }
The GWT response looks like:
//OK['C',[],0,7]
How do I go about bridging the two technologies? What is the correct way to dispatch JQuery Ajax requests and reply using GWT?
By the time you wrote your own code to make requests to, and parse the response from GWT-RPC you'd have rewritten a fair chunk of GWT.
Your best bet is either using GWT on the client side to handle the server communication (and then perhaps passing off the results to jQuery) or to write something like a servlet on the server side that is an alternate interface to the GWT-RPC calls.
However, if you insist on going down this road the place to start is this question: GWT RPC data format
the selected answer links a source for a basic overview of the format. For the full details though there is no choice but to dig into the source. The protocol isn't fully documented anywhere else.
这篇关于使用GWT后端但不使用前端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!