Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

J2me app access Servlet response

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a useful jar component. Now I want to extend to server and allow the remote j2me app to access it.

Say, I have

public Date getDate(String n){
return new Date();
}

I want the remote cell user to access it. So I add a servlet wrapper before this function.

public MyServlet extends HttpServlet {
doGet(..){
// here I call my component
Date d = getDate();
response.add(d); //how could I do this ?
}
}

But the problem is , how could I append this Date object to response ? The client side is a j2me application. What the j2me app is caring is the Date object , not html.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yuo do not have to return HTML, it can be just a String. HTML is really only a String, a String that includes HTML tags.

Just convert the Date object to a date string, and return that.

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