.wbmp pictures does not show up, why ?

Hello,

Problem:

I have created a Java servlet which produces a WML card with text and an command to load .wbmp picture (see code below). I have tested the WML card without servlet (loaded it straight from hard disk), and it works fine. The problem occurs when I try to use Tomcat 3.2.2 in my PC, run the servlet and load it with Nokia WAP toolkit 2.0. I managed to load the servlet and the text parts of the servlet are showing correctly, but the picture does not appear. Only the alt text.

I have configured Tomcats web.xml file as follows:

<mime-mapping>

<extension>wml</extension>

<mime-type>text/vnd.wap.wml</mime-type>

</mime-mapping>

<mime-mapping>

<extension>wbmp</extension>

<mime-type>image/vnd.wap.wbmp</mime-type>

</mime-mapping>

I have also tried to load pure WML code included in the servlet through Tomcat, text appears picture does not.

Same error occurs when I am using Nokia WAP server 1.1 instead of Tomcat.

This is probably some very simple error, but I can not see it myself. So any ideas,

Thanks in advance,

-TL

The servlet I am using:

import java.io.*;

import java.util.*;

import javax.servlet.*;

import javax.servlet.http.*;

public class TestServlet extends HttpServlet {

public void doGet(HttpServletRequest request,

HttpServletResponse response)

throws IOException, ServletException

{

response.setContentType("text/vnd.wap.wml");

PrintWriter out = response.getWriter();

out.println("<?xml version=\"1.0\"?>");

out.print("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML ");

out.println("1.1//EN\"");

out.println("\"http://www.wapforum.org/DTD/wml_1.1.xml\">");

out.println("<wml>\n<card id=\"card1\" title=\"Servletti\">");

out.println("<p>");

out.println("Testi servlet with picture");

out.println("<img src=\"http://localhost/sunny.wbmp\" alt=\"fig\" hspace=\"10\" vspace=\"10\" />");

out.println("</p>");

out.println("</card>");

out.println("</wml>");

out.close();

}

}

[2369 byte] By [tloikka] at [2007-9-26 2:17:44]
# 1
Hi, How do you manage to display the text out. I tried alot of time but it give me mime-type error. by the way, when you run the nokia simulator, did the tomcat run?Pls help me. Thanx.
caiyun01 at 2007-6-29 9:17:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Might it have something to do with the http://localhost url in the image src attribute. If the toolkit is being true to the phone then localhost will have no meaning to it. A server can be accessed by localhost but not the phone.
bobd3 at 2007-6-29 9:17:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

If You mean Nokia Toolkit with "Nokia simulator" then the answer is that Tomcat was up and running. With Nokia WAPserver I did not use Tomcat.

The mime error is probably caused by insufficient definitions in Your Tomcat web.xml file. You can copy the there the part of web.xml file I have used:

<mime-mapping>

<extension>wml</extension>

<mime-type>text/vnd.wap.wml</mime-type>

</mime-mapping>

<mime-mapping>

<extension>wbmp</extension>

<mime-type>image/vnd.wap.wbmp</mime- type>

</mime-mapping>

Then You must set Your Toolkit to use HTTP server Connection: Toolkit -> Device settings

Hope this helps,

T

tloikka at 2007-6-29 9:17:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
bobd3Thanks for Your answer, but...I Have tried to load the picture with and without localhost suffix. Only lines that appears to the screen are the text lines and teh alt text of the picture.-T
tloikka at 2007-6-29 9:17:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Another thought is that tomcat usually starts up using port 8080 not the default port 80 that the http:// url assumes if no port is given. The nokia wap server may not be running under port 80 either, so it may be that you need to check your port's.
bobd3 at 2007-6-29 9:17:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
i believe i have seen a good site for this by making a search on google with key word as wbmp pictures
pra.j at 2007-6-29 9:17:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

Hi,

Thanx for ur reply. However, i tried according to ur method. Still it give me error saying mime-type not supported.

I had tried running with and without the tomcat. The same error occur. Also, when i run the tomcat then run the nokia simulator, nothing happen at the tomcat. It still display the same default message, and not add in any message.

Any ideas?

Pls help. I been trying this since last week. I need to submit my project in 1 week time. Thanx.

caiyun01 at 2007-6-29 9:17:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...