Jonathan Hall wrote:
Hard to say without knowing what you are doing :)
So true, but let me re-ask that in a better way. Does using objects in
Restlet make sense? As in is there another method that preforms better,
is standard, or better supported that I should be using. The application
is just a client/server system, and I'm writing both ends so I can use
what ever works best.:)
Using ObjectRepresentation for a String is strange if that is your
usecase as it is meant for a serializable Java object.
If you are just wanting to pass plain text then you should use the
following:
if (variant.getMediaType().equals(MediaType.TEXT_PLAIN)) {
result = new StringRepresentation("Testing....");
}
The method you sent works, but now I get a different error. And of
course the client gets a big fat null object. I'm using Simple with
Apache Http Client.
application/x-java-serialized-object
Aug 22, 2007 7:43:15 AM com.noelios.restlet.LogFilter afterHandle
INFO: 2007-08-22 07:43:15 127.0.0.1 - - 8182 GET
/users/dog - 200 - - 29 http://localhost:8182
Noelios-Restlet-Engine/1.0.2 -
Aug 22, 2007 7:43:15 AM com.noelios.restlet.http.HttpServerConverter commit
INFO: Exception intercepted
java.io.IOException: Stream closed
at simple.http.ResponseStream.ensureOpen(ResponseStream.java:286)
at simple.http.ResponseStream.flushBuffer(ResponseStream.java:204)
at simple.http.ResponseStream.flush(ResponseStream.java:190)
at
com.noelios.restlet.http.HttpServerCall.sendResponse(HttpServerCall.java:312)
at
com.noelios.restlet.http.HttpServerConverter.commit(HttpServerConverter.java:90)
at
com.noelios.restlet.http.HttpServerHelper.handle(HttpServerHelper.java:95)
at
com.noelios.restlet.ext.simple.SimpleProtocolHandler.handle(SimpleProtocolHandler.java:66)
at simple.http.Dispatcher.run(Dispatcher.java:83)
at simple.util.process.Daemon.execute(Daemon.java:121)
at simple.util.process.Daemon.run(Daemon.java:106)
Aug 22, 2007 7:43:16 AM com.noelios.restlet.util.SecurityUtils parseResponse
--
Justin Stanczak
Stanczak Group
812-735-3600
"All that is necessary for the triumph of evil is that good men do nothing."
Edmund Burke