Re: [Wicket-user] Re: Re: Wicket serious bug with response encoding

2005-07-07 Thread Janne Hietamäki
Johan Compagner wrote: Maybe i can improve it even more by just doing that encoding conversion earlier (so not after the redirect but before the redirect and only store the byte[] that could be cheaper :) for strings that only take most of the time 1 byte) Yep, that's absolutely better. A

Re: [Wicket-user] Re: Re: Wicket serious bug with response encoding

2005-07-07 Thread Johan Compagner
i am a bit afraid for using that method that way... Because that could be pretty heavy.. Encoding is not a cheap operation and it will generate a byte array that also can be very big. And then suddenly if we still use PrintWriter we are encoding it twice... Maybe we should do this: byte[] byte

Re: [Wicket-user] Re: Re: Wicket serious bug with response encoding

2005-07-07 Thread Johan Compagner
that is something the PrintWriter does for you. But i don't know if i am willing to first generate a complete byte[] of that string to get the length and then get the Writer and print the stream.. Maybe there is some tool like: strings.calculateSize(string, encoding) That runs through all t

Re: [Wicket-user] Re: Re: Wicket serious bug with response encoding

2005-07-07 Thread Janne Hietamäki
Jan Bares wrote: You cannot calculate size of the string in bytes? I am not Java expert, but this must be easy. Size of the string in bytes is string.getBytes(encoding).length; Most frameworks don't set the content length, even if it's really bad for http keep-alive. Janne -