×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    1

    Question How to run wml code written in jsp

    How to execute this wml code in jsp file in emulator?


    <?xml version="1.0"?>
    <% response.setContentType("text/vnd.wap.wml"); %>

    <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN"
    "http://www.wapforum.org/DTD/wml13.dtd">
    <%@ page language="java" import="java.sql.*" %>
    <%
    String strUser = request.getParameter("username");
    String strPass = request.getParameter("password");
    Connection conn = null;
    Statement stmt = null;
    ResultSet rs = null;
    %>
    <wml>
    <card id="login" title="Login Information">
    <p mode="nowrap">
    <%
    String driver = "org.gjt.mm.mysql.Driver";
    try{
    Class.forName(driver).newInstance();

    String url="jdbc:mysql://localhost:3306/wap";
    String uname="root";
    String pass="";
    conn=DriverManager.getConnection(url,uname,pass);
    stmt=conn.createStatement();
    System.out.println("connection established");
    rs=stmt.executeQuery("select username,password from login");
    if( rs == null) {
    %>
    Database error while processing article <%= strUser %>
    <%
    }
    else if (strUser == null ||strUser.length() == 0)
    {
    %>

    Provide a proper article number

    <% }
    else if (!rs.next()) { %>

    There is no article with number <%=strUser %>

    <% }
    else
    {
    strUser = rs.getString(1);
    strPass = rs.getString(2);
    %>

    <table title="User Information" align="center" columns="2">
    <tr>
    <td><small><b>Username</b></small></td>
    <td><%= strUser %></td>
    </tr>
    <tr>
    <td><small><b>Password</b></small></td>
    <td><%= strPass %></td>
    </tr>

    </table>

    <%}
    }
    catch (Exception e) {
    out.println (e.getMessage());
    }
    finally
    {
    rs.close();
    if (conn != null) // and Connection objects
    conn.close();
    }
    %>
    </p>
    </card>
    </wml>

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    1

    Re: How to run wml code written in jsp

    i am working on nokia wap toolkit 4.1 with tomcat server.. i am not able to run my wml code since . . . i want to know where should i install wml code to run tat code. . .

Similar Threads

  1. Testing HTTP client for Nokia 3650; Looking to share code
    By nawkboy in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2003-09-10, 15:30
  2. resources in relation to content download over wap (sample wml code)
    By mauriceshephard in forum Digital Rights Management & Content Downloading
    Replies: 1
    Last Post: 2003-02-20, 09:59
  3. JSP run on Activ Server? Is it possible??
    By hgyang in forum WAP Servers
    Replies: 1
    Last Post: 2002-07-24, 13:31

Posting Permissions

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