It's not a secret anymore!
The moose likes Servlets and the fly likes J2me app access Servlet response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "J2me app access Servlet response" Watch "J2me app access Servlet response" New topic

J2me app access Servlet response

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
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 {
// 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

Joined: Feb 05, 2001
Posts: 17276

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.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: J2me app access Servlet response
jQuery in Action, 3rd edition