Solved

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

Posted on 2004-10-28
189 Views
Last Modified: 2008-02-26
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
0
Question by:armoghan
    5 Comments
     
    LVL 18

    Author Comment

    by:armoghan
    soory about the mistake in this line

    >>>>The problem is that I know there is **** NO**** ObjectStreams in J2ME to send and retireve objects.
    0
     
    LVL 18

    Author Comment

    by:armoghan
    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..

    0
     
    LVL 13

    Expert Comment

    by:petmagdy
    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
    0
     
    LVL 18

    Author Comment

    by:armoghan
    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.
    0
     

    Accepted Solution

    by:
    Closed, 300 points refunded.

    modulo
    Community Support Moderator
    Experts Exchange
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Cisco Complete Network Certification Training

    If you’re an IT engineer or technician, it's time you take your career to the next level. This elite training bundle is brimming with all of the information you need to learn to sit for Cisco CNNA, CCNP, and CCENT certification exams.

    Hopefully this article will help someone who's had the same issues I had. I have a Dell Wireless 1390 WLAN Mini-Card and Windows 7, and for the past couple of days I was beyond frustrated because my wireless laptop was not able to access the Inte…
    Multi-source agreements are important because they set standards that all manufacturers should follow to ensure that devices are compatible with multiple vendors. The multi-source agreement (MSA) is an agreement that establishes how multiple vendors…
    This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
    Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

    856 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now