On Thu, 2010-01-21 at 10:34 -0500, Christopher Schultz wrote:
> On 1/21/2010 6:43 AM, Mirko Solic wrote:
> > That what i'm afraid of. This code: new
> >  String(request.getHeader(headerName).getBytes("ISO-8859-1")) works for
> > now but it really shouldn't work.
> > That way i'm searching for more legitimate way.
> 
> What would be better is to do something like this:
> 
> java.net.URLEncoder.encode(request.getHeader(headerName), "UTF-8")
> 
> Of course, this will only work if your client knows that's how the
> encoding will be done.

Yes but what if mod_jk chooses not to send non ISO-8859-1 header values
over to tomcat side. According to André Warnier:
> But, because the HTTP RFC specifies that HTTP headers 
> should contain only US-ASCII character data, mod_jk would be allowed,
> if 
> it finds non-US-ASCII data in a HTTP header, to strip this data or 
> ignore the header or something like that.  I don't know if mod_jk 
> actually does this, but if it did, it would be justified, because 
> according to the HTTP RFC this would be an invalid header.

Than i have no values to decode to.


> AAI needs to support whatever encoding you intend to use. You can't
> simply transcode things in an arbitrary way and expect AAI to work
> properly. What does their documentation say about what format these
> values should take?

The problem is when i want to get data from AAI. AAI is sending data in
utf-8 but this is broken when data is send from apache side to tomcat
side.

> A better strategy would be for AAI to provide a numeric token (easily
> passable in HTTP headers without any encoding issues) and then provide
> an HTTP-based and/or XML-based API that uses proper document encoding to
> send textual data across the wire.
> 
> Using HTTP headers for text data sucks!

I agree with you here: Using HTTP headers for text data sucks!. But AAI
is not supported on tomcat yet. However it is supported on apache and
the only way for me if i want to use AAI and tomcat is to use mod_jk
connector. But mod_jk is transporting environment variables from apache
to tomcat in HTTP header.
And yes AAI sends data to apache in xml document not over http headers.
On apache side when data is received is is put in environment
variables. 

mirko


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to