Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing a web application from a midlet

 
Herbert Maosa
Ranch Hand
Posts: 289
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good ranchers,

I am wondering what technique is there to access a web application ( say a servlet ) from a midlet. I have a requirement to develop an end to end java appplication invloving J2EE and J2ME. All is well from the server side, but I ma hitting a blank wall when it comes to using a midlet to get the results from a servlet. The obvous problem is that the servlet is returning html code and my midlet is just dumping the html code on the screen, not interpreting into usable data.

Somebody tell me the trick....

Herbert.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well yes, when a Midlet uses a URL for an HTTPConnection, wheatever that Servlet sends as a response is what is displayed. It is just a byte array, or makes up a string of data. there is no interpretation of the data, you would need to code that yourself.

Usually the Servlet that a Midlet calls should just return a String of data that you want, not html tags. Again when I say string, I mean a string represented by a byte array.

Sometimes you can return XML and use a J2ME xml tool to read the data.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic