• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

Returning servlet info to a MIDlet

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ive sucessfully got servlets to display messages on a html pages with no real problems.

What I now need to do is get this message to be displayed back to the MIDlet application that requested it.

Has anyone on here done this before?

If so can they point me in the right direction of how I can do this (some example code would be great)

I would assume that it would be simular code to if you wanted to return a message to a normal Java Application.

Thanks in advance.

Darren
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
We've done something like that, writing to the payload on the servlet, and then parsing the response on the midlet.
HttpConnection con;
con= (HttpConnection) Connector.open(url,Connector.READ_WRITE,false);
Then we get the input stream of that connection and parse it as needed.
Pablo.
 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Darren,

i am also interested in the solution for your question, as i am preparing both the certifications, though i wont there in the exams...

after getting the things working, please post a self explanatory code to the thread, so that we can get an idea
 
Darren Jackson
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi mate.

After a long investigation I found these tutorials on the Sun One website:

http://developers.sun.com/techtopics/mobility/midp/articles/wtoolkit/

http://developers.sun.com/techtopics/mobility/midp/articles/tutorial2/

They take you through creating a MIDlet and the Servlet you need to make.

It took me a while to figure out but the responce is actually on a J2ME MIDlet Form with only one word on it.

From here you can develop the MIDlets GUI to be whatever you want.

The stage I am now stuck on is how to send a variable to a Servlet for a method to use???

Hope this helps.

Darren
 
Sheriff
Posts: 67556
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Darren Jackson:
The stage I am now stuck on is how to send a variable to a Servlet for a method to use???



Which is being discussed in your other post. Please don't start duplicate conversations.
 
Darren Jackson
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bear Bibeault:


Which is being discussed in your other post. Please don't start duplicate conversations.



Sorry it was not meant to be an invitation to start talking about it.

I dnt want to get into trouble :-S
 
I'm THIS CLOSE to ruling the world! Right after reading this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic