Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Returning servlet info to a MIDlet  RSS feed

 
Darren Jackson
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • 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
 
Pablo M�ller
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • 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.
 
Deepan Devadasan
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!