×

Discussion Board

Results 1 to 3 of 3

Thread: JSP in WAP

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    12

    JSP in WAP

    We are using Nokia Mobile Internet Toolkit v 3.0.

    We use JSP to print out WML, our problem is whenever we use JSP, the WAP emulator cannot display the GIF image.

    But if we simply use WML, the GIF image appears in the WAP page.

    Sample JSP is as follows:

    Code:
    <%@ page language="java" %>
    <%@ page import="java.util.*, java.io.*" %>
    <?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
    <% response.setContentType("text/vnd.wap.wml");
    out.println("<wml>");
    out.println("<card id=\"anniversary\" title=\"Imagesample\">");
    out.println("<p align=\"center\">");
    out.println("<img src=\"Snowboard.gif\" alt=\"Snowboard.gif\"/>");
    out.println("<br/>");
    out.println("<img src=\-snow.gif\" alt=\-snow\"/>");
    out.println("</p>");
    out.println("</card>");
    out.println("</wml>");
    %>
    The output from both WML and JSP looks like:

    Code:
    <wml><card id="anniversary" title="Imagesample">
    <p align="center">
    <img src="Snowboard.gif" alt="Snowboard.gif"/><br/><img src="3-snow.gif" alt="3-snow"/>
    </p>
    </card>
    </wml>
    Why is it that when we use WML the images are displayed, if we use JSP, images are not displayed? Please help. Thanks!

    =)

  2. #2
    Registered User
    Join Date
    Jun 2003
    Posts
    1
    Are you using tomcat along with apache?
    If so, you may have set up a handler for just the *.jsp files. This leaves the resolution of all other file extensions to apache. Apache will look for them under its DocumentRoot which may not match what tomcat uses.

    For example, on loading your JSP page, the wap browser will try fetch
    http://hostort/path/to/your/servlet/Snowboard.gif

    This may or may not resolve to the actual gif file depending on how you have configured apache and tomcat.

    You can try accessing this from any standard web browser to see what is returned. If you get a valid gif then its some other problem. If you get a HTTP error then you need to see why apache or tomcat can't locate your gif file.

  3. #3
    Registered User
    Join Date
    Apr 2007
    Posts
    1

    Re: JSP in WAP

    hello!!
    i'm new in wap application
    I want you to help bye giving me a guide how to setup tomcat & NMB in order to be abale to access my jsp file in tomcat through nokia mobile browser.
    I tried but if i give the url "http://localhost:8080/myappli-context/file.wml
    The browser show nothing ;
    please help me!!!!!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •