Direct call a RemoteServiceServlet

198 views
Skip to first unread message

GWT Newbie

unread,
Dec 2, 2008, 2:53:59 AM12/2/08
to Google Web Toolkit
Hello,

I have my application already done and running (servlet, jsp,
spring, ...).
I would like to add gwt in the front end because of its nice
components (tree and grid for instance).

I've done the differents tutorials with gwt alone and all is working
fine.
Now I want to go further : integrate gwt into my application :-)

The scenario: I would like to display a gwt tree thanks to a link
(href) from one of the web page of my application.

What I tried: I put a simple link (href) calling directly my class
which extends RemoteServiceServlet.

public class myRemoteServiceServlet extends RemoteServiceServlet {...}

and in the page :
<a href="/myContext/myRemoteServiceServlet?
param1Name=param1Value&param2Name=param2Value">

At a first try, it complains about missing GET methods. As a
consequence, I declare doGet and doPost which only call super.doGet
and super.doPost.

But after doing this, it now complains about :

============================================================================
16:07:48 [ERROR] - ApplicationContext.log(678) | Exception while
dispatching incoming RPC call
javax.servlet.ServletException: Content-Length must be specified
at com.google.gwt.user.server.rpc.RPCServletUtils.readContentAsUtf8
(RPCServletUtils.java:131)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.readContent
(RemoteServiceServlet.java:335)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:77)
============================================================================

Now my questions :
1) is it possible to call directly a subclass of
RemoteServiceServlet ?
2) does my process is good. If not, how should I process (to display a
gwt gadget from a link) ?

Thanks in advanced for your help,

Hieu.

Arul

unread,
Dec 8, 2008, 1:58:16 AM12/8/08
to Google Web Toolkit
Hi Hieu,
I wanted to know from you, is GWT replacement easily be implemented
into your existing project.

I am having one of my application displaying as Menus and
Submenus,.Selecting on each menu will call Servlet Class which inturn
calls Delegate and from there it calls DAO then results back to
Servlet class where it will be stored in session then finally the
target jsp redirected in servlet.

If I use some GET widgets how do I call directly servlet the same way
existing code does.

Thanks
Arul

gregor

unread,
Dec 8, 2008, 8:20:56 AM12/8/08
to Google Web Toolkit
Arul,

you have already asked this question here:

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/545cf2dbe9a7e50e/01ca78af99d38a08#01ca78af99d38a08

Didi you not understand something in the reply, or did you have a a
further question?

regards
gregor

Arul

unread,
Dec 9, 2008, 4:02:09 AM12/9/08
to Google Web Toolkit
Hi Gregor,
I would like to thank you for your reply.
I understood your answers regarding changing of presentation layer
concepts. But my client asked me to replace only presentation (Web
Tier) and I suggested GWT. I wanted to confirm the possibility of
doing it. I am doing research on that.

In order to code GWT RPC , I followed the steps mentioned at
http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=google-web-toolkit-doc-1-5&t=DevGuideCreatingServices,
it is working fins as said in the example.

Here one of stpes mentioed was creating of Asynchronous Interfaces,
which is not required my requirment. if i not followed this step then
getting error stating cient proxy not found..

Would you please creply though I not require the asynchronous
behaviour still, Do I need to create it?


Thanks
Arul

gregor

unread,
Dec 9, 2008, 5:22:57 AM12/9/08
to Google Web Toolkit
Hi Arul,

GWT RPC is anynchronous therefore you must follow the steps outlined
to use GWT RPC. If your client wishes to upgrade from a Struts/JSP
style application to a GWT UI, then it is usually better to replace
the entire current server side UI mechanism (i.e. the action classes
and JSP's etc) with the new GWT client and make the GWT client talk to
the existing application server implementation (e.g. EJB's/Spring etc)
directly via GWT RPC servlets.

have a look at this explanation from Summiit:

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/af54912ddc69a3fd#

It is possible to do it in "chunks" if they wish to test drive the
idea. You can pick a particular series of JSP's and replace one with a
GWT module hosting version that replaces them. You can then jump back
to the original struts application using RequestBuilder to mimic a
struts *.do call. If you cannot do the whole UI in one iteration, this
would probably be your best approach.

It is possible to embed GWT code within an existing JSP, but this has
more limited use because each GWT module runs within one page (i.e.
JSP) therefore you would need one GWT mini-app per JSP you wanted to
enhance none of which can easily talk to each other.

regards
gregor




On Dec 9, 9:02 am, Arul <arulmanikandan.sriniva...@gmail.com> wrote:
> Hi Gregor,
>   I would like to thank you for your reply.
> I understood your answers regarding changing of presentation layer
> concepts. But my client asked me to replace only presentation (Web
> Tier) and I suggested GWT. I wanted to confirm the possibility of
> doing it. I am doing research on that.
>
>  In order to code GWT RPC , I followed the steps mentioned athttp://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&s=goog...,
Reply all
Reply to author
Forward
0 new messages