Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User chema2424's Avatar
    Join Date
    Mar 2003
    Posts
    22
    I am trying to control if a midlet has been download correctly using the parameter MIDlet-Install-Notify but I do no know how to get the status code in my asp.

    Can somoeone help me?

  2. #2
    Nokia Developer Expert jalev's Avatar
    Join Date
    Mar 2003
    Posts
    382
    Hello

    Here Java servlet page for you, I hope you can find it usefull:


    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;


    public class InstallNotifyLoggerServlet
    extends HttpServlet
    {
    public void init(ServletConfig config)
    throws ServletException
    {
    super.init(config);
    }

    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException
    {
    log("GET! (Should be POST); pathInfo=\"" + request.getPathInfo() + "\""
    response.sendError(HttpServletResponse.SC_NOT_FOUND);
    return;
    }


    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException
    {
    log("POST; pathInfo=\"" + request.getPathInfo() + "\""
    BufferedReader reader = request.getReader();
    String line;
    while ((line = reader.readLine()) != null)
    {
    log("> " + line);
    }
    reader.close();
    }


    public String getServletInfo()
    {
    return "Install-Notify Logger Servlet.";
    }
    }


    This test servlet just writes Tomcat 'log messages' to the Tomcat server log file.
    (The name of the Tomcat 'log file' differs in different versions of Tomcat.)

    Normally an operator (or MIDlet provider) would have a servlet that logs such info into a database, e.g. phone number or customer such-and-such has installed MIDlet X

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved