Re: DefaultDOMWriter

Srinivas Yermal <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Thanks Christian and Jake.

I do agree that setting content-type is not such a great idea but, we 
have html content (a DOM object) that needs to be opened by the MS-excel 
application. Its more like a shortcut to handling direct excel format. 
So I set the content-type to "application/excel" even when the content 
is not, so that the browser forwards it to excel app and then the excel 
can simply open it as though it were a excel document. I hope that 
clears it up. Do you know any better way other than to set the content-type?

I think carrying the content type in the OutputOptions is another idea. 
So I can set it and pass that object to the DOMWriter and the write 
method could use it to set it in the response object.

Thanks,
Srini.

Jacob Kjome wrote:

> Hi Srini,
>
> At 02:22 PM 8/4/2003 -0700, you wrote:
>
>> In the write method of DefaultDOMWriter, the content-type is set 
>> without regards to what was set before. In my application, I provide 
>> a excel download using html content. So I need to set the 
>> content-type to application/excel for some html documents that I spit 
>> out. Does anybody have any suggestions?
>> Sorry if this question has already been asked. Please point me in the 
>> right direction.
>
>
> It is a good question.  I have a question for you.  Why would you use 
> a content type of "application/excel" for "html content".  if it is 
> "html", then it isn't an excel document.  Well, I'm probably missing 
> some details.  That said, I think you are right.   Overriding the 
> content type in DefaultDOMWriter is probably not a good idea.  I 
> wonder if that code shouldn't be removed entirely?  Would this cause 
> any problems for anyone?  I can imagine i might, but I'd like to hear 
> opinions from others.
>
> Jake
> _______________________________________________
> Barracuda mailing list
> [email protected]
> http://barracudamvc.org/lists/listinfo/barracuda
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.