[Home]  [List]  [News]  [Docs]  [FAQ]  [Downloads]  [Resources]  [About]
Search :
/Home /List

list4xt : Mailing list for the XT users community.

[list4xt] Re: response.setContentType("text,vnd.wap.xml")

Subject: [list4xt] Re: response.setContentType("text,vnd.wap.xml")
From: Eric van der Vlist (vdv@dyomedea.com)
Date: 01/12/2000 - 22:47


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://sunbirdinteractive.com
http://creditcardprocessing101.com -           http://hawaiianlifeguardassociation.com              http://shoppingcartsolution.com
------------------------------------------------------------------------

-- Mailing list for the XT users community. (http://adultdialersolution.com) (mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)



Archive générée par hypermail 2b28 le 06/11/2001 - 11:46 CET

webmaster@4xt.org


A site designed by Dyomedea