Hi,
I've been using GWT(google web toolkit) for a few days and it lets you map client requests to a Servlet function. It handles serializing the message passing I guess, so you end up with something like:
// clientside
MyServletInterface.java
myServletFunction(String s, Integer i);
// Server side
MyServlet.java
myServletFunction(String s, Integer i)
{
// whatever you want the servlet to do server-side.
}
So that is great. Now there's this chat protocol called Cometd and it's already setup using continuations and looks great. I'd like to use it with GWT but they've got their servlet implementation setup differently than I'm used to seeing with GWT (I guess actuallly this is the standard way of writing a servlet) they have this:
ContinuationCometdServlet.
java
void service(HttpServletRequest
request, HttpServletResponse response)
{
// handle client request
}
The source of that class is here (signatures are a little different but same idea I guess):
http://jetty.mortbay.org/jetty/jetty-7/xref/org/mortbay/cometd/continuation/ContinuationCometdServlet.htmlnow I'm not sure if GWT can interface with that at all, because GWT wants to let you define your own servlet signature where you're passing along any serializable objects, but here they're expecting the raw request and response objects.
I can get the raw request and service objects from a servlet function in GWT, I'm wondering if I can cheat somehow and just pass it through like:
MyServletCheatFunction(MyP
arameters)
{
// Just call the normal servlet function:
service(getRequest(), getResponse());
}
void service(HttpServletRequest
request, HttpServletResponse response)
{
// do what they normally do
}
Yeah that looks pretty bad but I'm wondering if anyone has any ideas as to how I could go about doing something like this?
Thanks
Start Free Trial