File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Elasticsearch in Action this week in the Big Data forum!
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: 17260

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 - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Don't get me started about those stupid light bulbs.
subject: J2me app access Servlet response