Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

How can I manipulate a servletData response?

Options
  • 24-12-2004 7:39pm
    #1
    Registered Users 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 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 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