You can't use two codec filters in the chain, due to the way the data
are passed from one filter to another one (we use IoBuffer for that).

This will be modified in 3.0, but don't expect this version to be out soon.

In the mean time, the only option is to wrap the textline codec into
the JSON codec. Not that easy, but not that complex too.

On Thu, Jul 16, 2009 at 7:04 PM, elf.cheng<[email protected]> wrote:
>
>        I'am using a JSON based Protcol in my server program based on
> mina.To
> deal with json string,I write  codecs to decode from string or
> encode to string.I used this codecfactory like the following:
>         acceptor.getFilterChain().addLast("logger", new
> LoggingFilter());
>      acceptor.getFilterChain().addLast("codec_txt", new
> ProtocolCodecFilter(new
> TextLineCodecFactory(Charset.forName("UTF-8"))));
>       acceptor.getFilterChain().addLast("codec_json", new
> ProtocolCodecFilter(new JsonCodecFactory()));
>
>        but the filter "codec_json" dose not work! who can tell me why?
>
> elf.cheng
>
>



-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Reply via email to