Hi,

I am new to GWT and I decided to try to create a simple application
that could do the following things:
- show all existing users in an html page (ListUsers.html)
- create a new user (NewUser.html)

I used the following approach to create the app:
1. created a GWT project in Eclipse under the package
com.senn.gwt.usersapp
2. created 2 EntryPoints: ListUsers.java & NewUser.java
3. created the module xml's:

ListUsers.gwt.xml:
<module rename-to='ListUsers'>
  <inherits name='com.google.gwt.user.User'/>
  <inherits name='com.google.gwt.user.theme.chrome.Chrome'/>

  <entry-point
class='com.senn.gwt.usersapp.client.entrypoint.ListUsers'/>

  <source path='client'/>
  <source path='shared'/>

</module>

NewUser.gwt.xml:
<module rename-to='NewUser'>
  <inherits name='com.google.gwt.user.User'/>
  <inherits name='com.google.gwt.user.theme.chrome.Chrome'/>

  <entry-point class='com.senn.gwt.usersapp.client.entrypoint.NewUser'/
>

  <source path='client'/>
  <source path='shared'/>

</module>

4. created a service (interface, impl, async interface)
those look like this:

@RemoteServiceRelativePath("userService")
public interface UserService extends RemoteService
{
        List<User> getAllUsers();
        void newUser(User user);
}

public interface UserServiceAsync
{
        void getAllUsers(AsyncCallback<List<User>> callback);
        void newUser(User user, AsyncCallback<Void> callback);
}

5. I then created html pages

Then the problem is this:
Since both modules use the same service, i'm not able to make them
both work at the same time.

It seems like I'm obligated to add the service like this in my
web.xml:

<servlet>
    <servlet-name>userService</servlet-name>
    <servlet-class>com.senn.gwt.usersapp.server.UserServiceImpl</
servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>userService</servlet-name>
    <url-pattern>/ListUsers/userService</url-pattern>
  </servlet-mapping>

And the NewUser page needs a /NewUser/userService.  I tried changing
the url-pattern to /users/userService but then I get 404s saying
there's no /ListUsers/userService.

How do I make this work without creating a service for every module?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to