You Are Here:

Community: Developer Discussion Boards

#1 Old HTTP Response Headers - 7650 - 2003-04-02, 16:35

Join Date: Apr 2003
Posts: 2
maxsan
Offline
Registered User
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
Reply With Quote

#2 Old 2003-04-02, 22:38

Join Date: Mar 2003
Posts: 112
ossipetz
Offline
me-2-j :)
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 :-)
Reply With Quote

#3 Old 2003-04-03, 09:46

Join Date: Apr 2003
Posts: 2
maxsan
Offline
Registered User
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
Reply With Quote

#4 Old 2003-07-03, 18:49

Join Date: Jun 2003
Posts: 9
alesud76
Offline
Registered User
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.
Reply With Quote

#5 Old 2003-07-04, 02:46

Join Date: Mar 2003
Posts: 34
rsmithh
Offline
Registered User
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.
Reply With Quote

#6 Old 2003-07-04, 10:29

Join Date: Jun 2003
Posts: 9
alesud76
Offline
Registered User
Thank you for your comments.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia