CSIT600b: XML Programming - WAP Guide
MSc(IT) Fall 2006
Our TA, Allen, suggested the following for WAP programming to you:
- The WAP emulator in
http://www.wapsilon.com/ is tested to work perfectly if we modify
our code a little.
- In the Html2dom.java, before we do a transform we need to specify
the content type. Below is an example (the variable names may be
different from yours):
// when the output is html, set MIME type to text/html
if (xslt2UrlStr.contains("xslt2")) {
response.setContentType("text/html");
}
// when the output is wml, set the correct MIME type
else if (xslt2UrlStr.contains("xslt3")) {
response.setContentType("text/vnd.wap.wml");
}
t.transform(new DOMSource(result), new
StreamResult(response
.getOutputStream()));
A working example is
here