I am having an issue with using a String as a parameter to a ClientProxy
created by GWT. When the ObjectRepresentation of the String object is
deserialized on the server it shows up as java.lang.String/12341234 instead of
the actual string. Here are some code snippets:
proxy definition using org.restlet.client.resource.ClientProxy
public interface MyClientProxy extends ClientProxy
{
@Post
public void getFullName(String username, Result<String> result);
}
How it's used
MyClientProxy proxy = GWT.create(MyClientProxy.class);
proxy.getClientResource().setReference(GWT.getModuleBaseURL() + "get");
proxy.getClientResource().getClientInfo().getAcceptedMediaTypes().add(new
Preference(MediaType.APPLICATION_JAVA_OBJECT_GWT));
proxy.getFullName(textToServer, new Result<String>(){
@Override
public void onFailure(Throwable caught){
serverResponseLabel.setHTML(SERVER_ERROR);
}
@Override
public void onSuccess(String result){
serverResponseLabel.setHTML(result);
}
});
The server code that's called
public class MyServerResource extends ServerResource
{
@Post
public String getFullName(String uname){
if ("bkcabana".equals(uname))
return "Brian Cabana";
else
return uname;
}
}
If you set a breakpoint at the if(...) the uname is java.lang.String/<some int>
instead of the actual string.
Am I missing something obvious or is there in issue with the GWT Serialization
of the String parameter?
Any help is appreciated.
Brian
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2663772