| Reply | « Previous Thread | Next Thread » |
|
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 |
|
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 :-) |
|
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 |
|
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. |
|
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. |
|
Thank you for your comments.
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|