list4xt : Mailing list for the XT users community.
[list4xt] Re: Eric: response.setContentType("text,vnd.wap.xml")
Subject: [list4xt] Re: Eric: response.setContentType("text,vnd.wap.xml")
From: guy (guy@polylab.sfu.ca)
Date: 05/12/2000 - 20:53
Eric,
As to your second suggestion, to modify XMLOutputHandler, can I write a class
that will override the
this.out = dest.getOutputStream("application/xml", null);
with
String mediaType = atts.getValue("media-type");
and I assume
this.out = dest.getOutputStream(media -type, null);
so I don't have to modify XMLOutputHandler or use you whole XHTMLOutputHandler?
Thanks for your patience
Guy
Eric van der Vlist wrote:
> Oooops, sorry, my mistake !
>
> There is a mechanism that passes the HttpServletResponse to the output
> handler:
>
> public void doGet(HttpServletRequest request, HttpServletResponse
> response)
> throws ServletException, IOException {
>
> .../...
> outputMethodHandler.setDestination(new ServletDestination(response));
>
> but the media type is NOT used in the XMLOutputHandler:
>
> public DocumentHandler init(Destination dest, AttributeList atts)
> throws IOException {
> this.out = dest.getOutputStream("application/xml", null);
>
> If my implementation is working, it's because I am not using the
> XMLOutputHandler but my XHTMLOutputHandler [1] that does use the
> mediaType:
>
> public DocumentHandler init(Destination dest, AttributeList atts)
> throws IOException {
> String mediaType = atts.getValue("media-type");
> if (mediaType == null)
> mediaType = "text/html";
>
> I had omitted to say this since my motivation for using this output
> handler was to send iso-8859-1 documents (which XMLOutputHandler doesn't
> support) and I had assumed the 2 methods had the same way to handle the
> media types !
>
> As a short term solution, you can either use the XHTMLOutputHandler or
> modify the XML OutputHandler as shown above.
>
> Sorry for the confusion.
>
> Eric
>
> [1]
> /downloads/examples/outputhandlers/xhtml/XhtmlOutputHandler.java
>
> --
> See you at XML 2000
> http://gca.org/attend/2000_conferences/XML_2000/building.htm#vlist
> ------------------------------------------------------------------------
> Eric van der Vlist Dyomedea http://innovationsummit2017.com
> http://highvolumemerchants.com - http://androidblackmarket.org http://medicalcannabiscaregivers.org
> ------------------------------------------------------------------------
>
> --
> Mailing list for the XT users community. (http://luxvapers.com)
> (mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)
--
Mailing list for the XT users community. (http://balticbankinggroup.com)
(mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)
Archive générée par hypermail 2b28 le 25/04/2001 - 07:16 CEST
webmaster@4xt.org
|