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

Populate Servlet Data in J2ME Application

 
Pat Ryan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i seperate the servletData received from a JSP? I want to populate a UserProfile form in a J2ME application with existing info taking from a MySQL DB. However the servletData response is one big stream. When i print it a text field in the J2ME application, all the data is printed in one line. How can break the data up so as to populate the appropraite fields??

Cheers in advance!
[ December 24, 2004: Message edited by: Pat Ryan ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, here's the deal. Yes it will come in one big string, so to speak, so the key is to have a character that seperates the fields, then you can parse the String on the J2ME side to put into seperate fields or variables.

If you cannot change the Servlet program to put in these seperators, then create a wrapper Servlet that will call the original Servlet, get the data, then create the new String with the seperators to return to the J2ME device.

Hope that helps.

Mark
 
Ofer Gurman
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest using xml for that purpose. Simply enter the data you need into an xml rather then have to put some kind of delimiter and then parse it.
 
pat barry
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would the XML do that? I have the same problem and I've never used XML much!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic