Re: setting appropriate content-type

2006-07-14 Thread Bill Au

Make sense to me too.

Bill

On 7/13/06, Chris Hostetter [EMAIL PROTECTED] wrote:



: response.setContentType(
: responseWriter.getContentType(solrReq, solrRsp) );

+1



-Hoss




Re: setting appropriate content-type

2006-07-12 Thread Yoav Shapira

Hi,

On 7/12/06, Yonik Seeley [EMAIL PROTECTED] wrote:

So, right now, the Solr servlet always sets a content type of
text/xml;charset=UTF-8 before getting the Writer to write the
response.

snip /

So the new method is QueryResponseWriter.getContentType():String, and
I also pass the request and response so content-type could change
based on either of those.

Make sense?  Any other suggestions?


Makes sense, no problem there.  Just a minor / side comment: you
should check that the response is not committed before setting the
content type.  That provides better support for filtering, e.g. some
earlier or later Filter in the processing chain to set the response
type.  A lot of sites nowadays, for example, have a Filter that sets
content type on UTF-8 for everything.  It's a nice way to do content
type in a universal manner without modifying every single servlet.

As I said, just a side comment, tangential to your approach here,
which I think is fine.

Yoav


Re: setting appropriate content-type

2006-07-12 Thread Chris Hostetter

: response.setContentType(
: responseWriter.getContentType(solrReq, solrRsp) );

+1



-Hoss