Java Reference
In-Depth Information
entities.add(tee);
}
return entities;
}
}
Modifying the Deployment Descriptor
Since your service implementation runs on the server as a servlet, you need to tell
the embedded Servlet container where to find the code to execute. Open the
web.xml file in the project's war directory and add the entries in Listing 7-9. The
URL pattern for the dataServlet corresponds to the
@RemoteServiceRelativePath("data") annotation in the DataService interface
that you added earlier.
Listing 7-9. The web.xml definition for the DataServiceImpl servlet
<servlet>
<servlet-name>dataServlet</servlet-name>
<servlet-class>com.appirio.timeentry.server.DataServiceImpl</servlet-
class>
</servlet>
<servlet-mapping>
<servlet-name>dataServlet</servlet-name>
<url-pattern>/timeentry/data</url-pattern>
</servlet-mapping>
Invoking the Service from the GWT Client
Now that the server side of your application is complete, you need to implement the
client-side code that invokes your service. Before you make your modifications to
your EntryPoint class, you need to add one more component for your GWT RPC calls.
You need to add an AsyncCallback parameter to each of your server-side calls for
your DataService . Your new interface in Listing 7-10 must be located in the same
package as your service interface and it must have the same name as the interface but
appended with Async .
 
Search WWH ::




Custom Search