GWT: Google Web Toolkit: Difference between revisions

From Elvanör's Technical Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 3: Line 3:
== Java exceptions in the server side code ==
== Java exceptions in the server side code ==


They need to implement IsSerializable.
They need to implement IsSerializable. You must thus specify on your server code that the function throws <tt>SerializableException</tt> and not just <tt>Exception</tt>.
 
<pre>
public interface ShopServices extends RemoteService
{
/**
*
* @gwt.typeArgs <com.example.client.ShopCategory>
*/
public Set getShopCategories() throws SerializableException;
}
</pre>
 
== GWT automatic serialization ==
 
Be careful that GWT automatic serialization, especially for collections, can be tricky. You must specify in your Java source code what your collections contain. Maybe with Java 1.5 the situation will improve.

Revision as of 17:12, 21 March 2007

This page collects various information about GWT programming.

Java exceptions in the server side code

They need to implement IsSerializable. You must thus specify on your server code that the function throws SerializableException and not just Exception.

public interface ShopServices extends RemoteService
{
	/**
	 * 
	 * @gwt.typeArgs <com.example.client.ShopCategory>
	 */	
	
	public Set getShopCategories() throws SerializableException;
}

GWT automatic serialization

Be careful that GWT automatic serialization, especially for collections, can be tricky. You must specify in your Java source code what your collections contain. Maybe with Java 1.5 the situation will improve.