Persisting value obtained by Servlet from the MIDlet

S

Saaji

Hi ppl,
I'm passing a parameter from my MIDlet code which is running via
OTA on to the servlet which is running on my localhost using the
HTTPConnection.GET method. My servlet page (depending on where I'm
passing the parameter to) displays the value on the Tomcat console as
long as I give a sysout on that page. But when I try accessing it from
my browser, it returns a value of null. Is there some way in which I
can make this value which i'm getting once persist till I get another
value from the MIDlet without utilising many resources? (please read
that as in a very simple way..)

I'm using a request.getParameter() from my JSP and a
request.getReader().readLine() from my Servlet. Or is there any way in
which I can obtain values from the mMIDlet only when I need them?

I'm using my Java Wireless Toolkit to run the MIDlet using the OTA
provision.

Thanks and Regards,
Sajida
 
A

anu

if you want a value to persist ,you can set it as a session
variable.use the following code in the servlet
request.getSession().setAttribute("somevalue",currentvalue);
and wherever you want this object retrieve it using
request.getSession().getAttribute("somevalue");
hope this may help you
 
S

Saaji

Hi,
This is not what I meant. Let me rephrase my query. I invoke my
servlet from the MIDlet and pass some valus which I retrieve in my
Servlet. This happens without me even invoking the servlet in my
Browser. Now when I open up my browser and run this jsp/servlet again,
I want to retrieve those initial values sent by my MIDlet. How can I do
that? I think the above response is invalid because the session in both
cases is different..

Thanks in Advance,
Sajida
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,201
Latest member
KourtneyBe

Latest Threads

Top