×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    2

    HTTP Response Headers - 7650

    Hi,

    I've a MIDlet that use HTTPConnection (POST) to establish a connection to a servlet.
    I try to use URL-rewriting for Session Tracking:

    SERVLET
    HttpSession session = req.getSession(true);
    if (session.isNew()){
    String sIncomingURL = req.getRequestURL().toString();
    String sURLwithID = res.encodeURL(sIncomingURL);
    res.setHeader("rewritingURL", sURLwithID);
    }

    Why in my MIDlet this http.getHeaderField("rewriting URL") return always null value?:

    MIDLET
    //##### URL-Rewriting #####
    sServletURLWidthID = http.getHeaderField("rewriting URL");
    if (sServletURLWidthID != null) _sURLServlet = sServletURLWidthID;

    sServletURLWidthID is always null

    Can it be the WAP Gateway?
    Which type of Gateway do I have to use?

    Thanks.

    Massimiliano

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    112
    well:
    servlet> res.setHeader("rewritingURL", sURLwithID);

    and:
    midlet> sServletURLWidthID = http.getHeaderField("rewriting URL");

    is not the same field. there is a space in the getHeaderField call (rewriting_Url)

    well its maybe not the thing but its not how its supposed to be :-)

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    2
    Hi ossipetz,

    yes I know, this is not the problem it's only an error writing the email.
    I'm sure that the two keys are the same.

    Thanks anyway

    Massimiliano

  4. #4
    Registered User
    Join Date
    Jun 2003
    Posts
    9
    Hi,
    I have the same problem with my nokia 7650.

    String cookie = conn.getHeaderField("Set-cookie");
    return ever null on mobile and work fine on the emulator.

    Ask anyone know if 7650 needed ability cookie??

    Ciao Alessio.

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    33
    Two comments ...

    Using cookies to track sessions in J2ME is a *bad* idea. This is because on those handsets which implement http over WAP, most WAP gateways have the habit of munging or simply discarding cookies. You're much better off implementing the session as a piece of application data.

    Secondly, the 7650 (or at least my 7650) implements http over TCP/IP so there is no WAP gateway involved.

  6. #6
    Registered User
    Join Date
    Jun 2003
    Posts
    9
    Thank you for your comments.

Posting Permissions

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