> > VelocityServlet doesn't currently support the
> ability to override the
> > character encoding of its output on a per-request
> basis.  Instead,
> > it's hard-wired to the single value from the
> configuratin of the
> > RuntimeSingleton.  For I18N'd applications, this
> is painful.  The pain
> > can be alleviated by inserting a hook method for
> determining the
> > output character encoding to use on a per-request
> basis.

> > The above is a no-brainer.  However, I'd like the
> behavior of the
> > mergeTemplate() method be changed by having the
> default implementation
> > of this hook method first attempt to get the
> character encoding to use
> > from the response object, and only fall back to
> RuntimeSingleton's
> > config if not available from the respone.
> 
> hmm.  not sure about this implementation.  the
> servlet spec says that
> ISO-8859-1 is used implicitly if no charset has been
> assigned.  i just ran a
> quick trial (the veltools simple example on Tomcat
> using a VVS modified to ask
> the response for the character encoding before the
> template merge) where i
> neither explicitly set the Locale, nor did i set a
> charset in the content type
> and response.getCharacterEncoding() returned
> "ISO-8859-1" instead of null.
> this may just be a matter of my ignorance, but does
> response.getCharacterEncoding() ever return null?

I think response.getCE method will always return
something meaninful. Althought servlet spec does not
say anything strickt here.

request.getCE _will_ return null most of the time
'cause browsers dont currently add content-type header
on httprequests. It's a common practise to use
SetContentTypeFilter to add contentType value. This
will ensure, that request.getReader will return a
properly instantiated InputStreamReader.


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to