×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    1

    Problem While redirecting from servlet to a wml page

    Hello everybody

    I am a beinner in wml and servlets. I have a bt of a problem over here form my servlet i want to redirect to a wml page. Following is the code I have written:
    PrintWriter out = response.getWriter();
    String url="/emailreaderswap/login.wml";
    response.addHeader("Content-Location:", Double.toString(Math.random())); response.setContentType("text/vnd.wap.wml");
    out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?> ");
    out.println("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.3//EN\" ");

    out.println("\"http://www.wapforum.org/DTD/wml13.dtd\"> ");
    out.println("<wml>");
    out.println("<card>");

    out.println("<p>"+ "Email Address or Password are wrong Please Try Again!\r\nClick On The Link Below to go back to Login Page"+
    "<a href=\""+url+"\">Login</a>");
    out.println("</p>"+
    "</card>"+
    "</wml>");

    But the Nokia Mobile Browser gives me "malformed url " as error.

    Please Guide me about this problem
    I hope for an early reply from you ppl as I have a deadline to meet

    Eagerly waiting for a reply

    Thankyou
    Heti Shah
    Last edited by hetishah; 2006-02-23 at 06:37. Reason: Typing prob

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

    Re: Problem While redirecting from servlet to a wml page

    may be you need href="http://localhost:8080/myproject/index.wml#Login">

  3. #3
    Registered User
    Join Date
    Feb 2009
    Posts
    5

    Re: Problem While redirecting from servlet to a wml page

    hi

    if i have got it right then your constructed url gets to /emailreaderswap/login.wml.. but ,its uncomplete due to quotation marks ...
    what u need is..<"a href=\""+url+"\"">Login</a>

    And ya if login.wml is in the same context then url="login.wml" will also work
    mean to say, out.write("<a href=\"login.wml\">Login</a>");

    By the way.. why r u using servlets.. jsp would be more easier to design and work

    And ya as u r also working on wml plz look at my problem "On event problem"too.. may u find a solution

Similar Threads

  1. Replies: 1
    Last Post: 2005-12-18, 20:44
  2. 500 error while accessing a wml page
    By ernitingoel in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2004-11-17, 06:03
  3. The 7110 times out as it trys to make a connection to my wml java servlet r
    By Nokia_Archive in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2002-05-15, 20:47
  4. Calling a scripting page from wml
    By Nokia_Archived in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2002-05-14, 19:09

Posting Permissions

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