Question

I can't seem to figure out how to send a simple string to the client. Every time I try it like this

@Override
public NextAction handleRead(FilterChainContext ctx) throws IOException {
    ctx.write("test");
    return ctx.getInvokeAction();
}

it throws an error:

java.lang.ClassCastException: java.lang.String cannot be cast to org.glassfish.grizzly.asyncqueue.WritableMessage

I tried implementing my own WritableMessage, which it then sends but it doesn't work. I can't figure out how to set it up properly, or if it's the right way.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top