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
- References:
- Convert from String Array to String
- From: Stuart Halloway
- Convert from String Array to String
- From: Aaron Scott-Boddendijk
- Convert from String Array to String
- From: Gokul Singh
- Convert from String Array to String
- Prev by Date: NYJavaSIG - Java Pink Noise 10/31/00
- Next by Date: J323 Engine and CommonRule techs off alphaworks
- Previous by thread: Convert from String Array to String
- Next by thread: Any UDP port in the Internet
- Index(es):