Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sending wml page from a servlet


  • From: mailing_list_sg@xxxxxxxxx (Kwan Hon Luen)
  • Subject: Sending wml page from a servlet
  • Date: Tue, 31 Oct 2000 13:26:08 +0800

Hi ,
    I am reaching a situation here.

    There is a servlet that is designed to return wml page below.

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml";>
<wml>
 <card id="GetPicCard" title="GetPic">
  <p>
  <img src="sunny.wbmp" alt="sunny"/>
  </p>
 </card>
</wml>

    When I load this page from a static file e.g. pic.wml, the WAP browser
will display the wbmp image.

    When I load the servlet that is designed to return this page, the WAP
browser does not display the image and shows the alt label instead.
    There is an error code 404, which means SC_NOT_FOUND.

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class MyServlet extends HttpServlet
{
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    {
        res.setContentType("text/vnd.wap.wml,image/vnd.wap.wbmp");
        PrintWriter out = res.getWriter();

        out.println("<?xml version=\"1.0\"?>");
        out.println("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"
\"http://www.wapforum.org/DTD/wml_1.1.xml\";>");
        out.println("<wml><card id=\"GetPicCard\" title=\"GetPic\"><p><img
src=\"sunny.wbmp\" alt=\"sunny\"/>");
        out.println("</p></card></wml>");
    }
}

    This servlet is stored using the Java Web Server. I have added the mime
type for wml, wbmp, wmlc, wmls, wmlsc, and this problem is still existing.
    Does anyone know?


Regards,
Hon Luen




_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx