This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Succeeding with AI and have Veljko Krunic on-line!
See this thread for details.
Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Accessing a web application from a midlet

 
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.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE 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
 
This tiny ad is wafer thin:
ScroogeXHTML 8.7 - RTF to HTML5 and XHTML converter
https://coderanch.com/t/730700/ScroogeXHTML-RTF-HTML-XHTML-converter
    Bookmark Topic Watch Topic
  • New Topic