Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

How can I manipulate a servletData response?

  • 24-12-2004 06:39PM
    #1
    Registered Users, Registered Users 2 Posts: 194 ✭✭


    How can i seperate the servletData received from a JSP?
    I want to populate a UserProfile form in a J2ME application with existing info taken from a MySQL DB. However the servletData response is one big stream. When i print it a text field in the J2ME application, all the data is printed in one line. How can break the data up so as to populate the appropraite fields??

    Cheers in advance!


Comments

  • Registered Users, Registered Users 2 Posts: 932 ✭✭✭yossarin


    just delimit and parse the list ?
    if this database is on an external sever then delimit it on the server side if you can and only send the info that you want to use.

    Is servletData a servlet response type ? I never heard of it in sun java.


  • Registered Users, Registered Users 2 Posts: 194 ✭✭pbarry


    The servletData is defined below, my problem is that the password and username are in one stream (servletData) and I want to display them seperately in the appropriate fields.


    if (http.getResponseCode() == HttpConnection.HTTP_OK )
    {

    iStrm = http.openInputStream();

    int length = (int) http.getLength();
    if (length > 0)
    {
    byte servletData[] = new byte[length];
    iStrm.read(servletData);

    userNameLoginField.setText(new String(servletData));
    passwordLoginField.setText(new String(servletData));
    }
    }


Advertisement