Link to home
Start Free TrialLog in
Avatar of armoghan
armoghanFlag for Pakistan

asked on

Need to send Objects from over HTTP to a servlet using standard J2ME, MIDP 2.0

I want to communicate with a servlet or JSP page, from J2ME. I want to open a connection and send Objects to servlets.

The problem is that I know there is ObjectStreams in J2ME to send and retireve data.
So one way is to change the object to a string manually and send the data. Other is some automated way..

Is there any automated way like the way ObjectStreams work..

Either convert the objects to bytes and send them, and reconstruct them on the other end..

Thanx for the help in advance
Avatar of armoghan
armoghan
Flag of Pakistan image

ASKER

soory about the mistake in this line

>>>>The problem is that I know there is **** NO**** ObjectStreams in J2ME to send and retireve objects.
One way could be to convert the objects to XML and then send them and convert them back on otherside..
Is there any API in J2ME to do so.. may be using KXML or anyother XML parser..

If u worked with struts, their is a simpler way make ur J2ME send the object attributes as url parameters to a Struts action, that action should have a registered Struts form and make the url parameters names the same as the Form fields names, on the struts u will automatically recieve it as the specified Form object
No i do not want to send object attributes.

I want to send the whole object. as it may be much bigger. May have anything upto an image/arraylists etc

I have read that article which shows how to concatinate the parameters in URL and send it to struts which will make a work itself.
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial