aspose file tools*
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
Author

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 {
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

Joined: Feb 05, 2001
Posts: 17250
    
    6

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


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: J2me app access Servlet response