使用GWT RPC机制与我定制的Servlet [英] using GWT RPC mechanism with my customized Servlet
问题描述
目前,我有它使用 RequestBuilde
来GWT应用程序
将消息发送到我已经(使用 POST
和 GET
)的Servlet和我的servlet
(在的doPost
和的doGet
)暂停的要求(这是通过使用完成
Servlet的3.0规范),并把它添加到队列中。结果
另外我有一个
它运行在后台守护线程中扮演的要求
当有新的数据。结果
这一点,我只是送我除了事实的伟大工程
现在,我的字符串想利用RPC机制发送
对象。结果
我的问题是这样的:
如果我创建 myServiceImpl
类延伸 RemoteServiceServlet
我应该如何处理的doPost
和的doGet
如果在所有?结果我需要暂停我的请求,利用异步支持,应该在哪里可能?我虽然也许叫 this.getThreadLocalRequest()
方法在我的RPC方法 myServiceImpl
类,但我不知道多么明智,这将是。结果我不
相信我即使知道GWT如何处理从客户端调用
那异步接口。
万一调用它是否在的doGet
为例的servlet和
确保它调用所需的RPC方法?结果
对不起,如果我做乱七八糟的东西它只是我找不到更多
详细技术信息,因为这RPC企业究竟是如何工作的。结果
鸭preciate任何借贷手结果
以太
I currently have a GWT application which uses the RequestBuilde
to
send messages to a servlet I have (using POST
and GET
), and my servlet
(in doPost
and doGet
) "pauses" the request (this is done by using
Servlets 3.0 spec) and adds it to a queue.
Additionally I have a
Daemon thread which runs in the background and "plays" the request
when there is new data.
This works great for me apart from the fact that I'm just sending
strings for now and I'd like to utilize the RPC mechanism to send
Objects.
My question is this:
If I create my myServiceImpl
class which extends
RemoteServiceServlet
how should I handle the doPost
and doGet
if at all?
I need to pause my request to utilize the asynchronous support, where should this be accomplished? I though maybe to call this.getThreadLocalRequest()
method in my RPC method in myServiceImpl
class but I'm not sure how wise that will be.
I'm not
sure I even understand how GWT handles the call from the client side
of that asynchronous interface.
Does it by any chance call the doGet
for example of the servlet and
makes sure it calls the required RPC method?
I'm sorry if I made a mess of things it's just that I can't find more
detailed technical information as exactly how this RPC business works.
Appreciate any lending hand
Ittai
推荐答案
我认为主要的误会我在当时是与该GWT RPC建立在servlet的机制(内部)等试图利用该机制的事实异步servlet的是,在当时,不可能的,因为GWT RPC是建立在servlet的2.5(再次,在时间)。
I think the main misunderstanding I had at the time was related to the fact that GWT RPC builds on the servlet mechanism (internally) and so trying to use that mechanism with asynchronous servlets was, at the time, impossible since GWT RPC was built on servlets 2.5 (again, at the time).
这篇关于使用GWT RPC机制与我定制的Servlet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!