That's kind of up to you really - depending on how you want to break down your application into servlets, and how you want to "partition" the GWT RPC services you need across servlets.

Assuming your using GWT RPC (which is all we've used) then on the client side, you create a URL that contains the root path + the alias to the servlet that you want to handle the RPC.

The key thing to remember is GWT-RPC associates a back-end RPC service with a URL - which from my understanding means :

   * 1 URL = 1 Java interface (and it's Async proxy) for the GWT
     service client side = 1 servlet to provide the service server side

So you can think of this 1:1 mapping from URL through to GWT RPC service as your unit of modularity

In our app we've used around 5 or 6 top-level handling servlets e.g.

Client Services
Environment Services
Event Log

etc.

Each of these does the bridging between the incoming GWT RPC calls, and the back-end OSGi services that make up our core application

You could equally go with one very large "interface servlet" for all your calls, although that wouldn't be a very modular design it would involve less plumbing on the servlet side. Or you could go with separate servlets for every service area of your application, which would be nice and modular but then you'd have to create register every servlet, along with any framework scaffold/plumbing that your servlets need. We chose to break down our application's main functional areas and create a separate servlet for each.

Hope this helps

Regards

-- Rob

Vinicius Carvalho wrote:
Rob, I'm sorry about this dumb question, since I'm new to GWT as well. Do we
need to register every servlet we got? Or GWT works on a front controller
way?

Regards

On Mon, Dec 22, 2008 at 5:11 AM, Rob Walker <[email protected]> wrote:

Vinicius Carvalho wrote:

Thanks Rob, your email was very helpful, we are just starting next week
with
some minor implementation on the new architecture, I'll certainly use this
as a reference, thanks for sharing.



You're very welcome.

I may have missed some parts out - so if you get stuck on any of the basic
plumbing, email Felix users and I'll see if I can help.

Like I mentioned below, we saved a lot of pain by having the 3 key parts in
one bundle:

  * gwt-user.jar
  * compiled GWT client code and resources
  * compiled Java server code.

I'm sure it's cleaner to separate some or all of these, but you'll have to
figure a whole lot more imports and exports, and it's likely to be something
you have to check or re-visit every GWT release. We've gone from early GWT
beta to 1.5 with little or no change to our bundle packaging process, so
it's been labour saving for us to use this model

Regards

-- Rob




--


Ascert - Taking systems to the Edge
[email protected]
+44 (0)20 7488 3470
www.ascert.com

Reply via email to