×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    29

    HttpConnection to Servlet

    I am trying to connect to a Servlet in LocalHost. Using WTK1.0 its possible but with WTK2.0 the emulator is asking wether to connect or not. and I am unable to proceed further. Please suggest to make it default connection or ok-ing of the request.

  2. #2
    Registered User
    Join Date
    Jun 2003
    Posts
    4
    Make you connection in a seperate thread something like this:
    Thread t = new Thread() {
    public void run() {
    connect();
    }
    };
    t.start();

    in the public void commandAction(Command c, Displayable s) method.

    And select "yes this time" option when asked for connection.

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    29

    Thanks iqbalsh

    Thanks dear,

    Problem solved. Actually my querry string containd a space which was not accepted. So i wrote a method to convert the string to URL.(by converting the string to Hexadecimal values)

  4. #4
    Registered User
    Join Date
    May 2003
    Location
    Tropical Paradise Penang
    Posts
    43

    Please help

    How do you guys do HttpConnection in WTK104 emulator? Are you guys using Series_60_MIDP_SDK_for_Symbian_OS_v_1_0 device emulator?

    I can't seems to connect to my http://localhost:8080/someServlet

    Can anyone guide me on how to do this? I'm working on Series 60 emulator (C:\WTK104\wtklib\devices\Series_60_MIDP_SDK_for_Symbian_OS_v_1_0)
    and seems can't connect to my Tomcat/Resin web server.

    Anyone please help?

  5. #5
    Registered User
    Join Date
    May 2003
    Location
    Tropical Paradise Penang
    Posts
    43

    By the way...

    When I try to connect, the Nokia emulator in WTK104 prompt me to connect via Direct HTTP, but when I click OK I get this:

    c= com.symbian.midp.io.protocol.http.Connection@1cb37664
    java.io.IOException: Status = -20028
    at com.symbian.cldc.connection.ConnectionEndPoint.writeBytes(+140)
    at com.symbian.cldc.connection.OutputStream.flush(+23)
    at com.symbian.midp.io.protocol.http.HttpConnection.sendRequest(+101)
    at com.symbian.midp.io.protocol.http.HttpConnection.ensureResponse(+40)
    at com.symbian.midp.io.protocol.http.HttpConnection.openDataInputStream(+15)
    at com.symbian.midp.io.protocol.http.HttpConnection.openInputStream(+4)
    at example.http.HttpTest.readContents(+154)
    at example.http.HttpTest.commandAction(+34)
    at javax.microedition.lcdui.Displayable.commandAction(+29)
    at javax.microedition.lcdui.Toolkit.postEvent(+78)
    at com.symbian.midp.compatibility.runtime.KVMEventProcessor.run(+27)
    class java.io.IOException
    java.io.IOException: Status = -20028
    Exception reading from http
    java.io.IOException: Unexpected end of stream
    at com.symbian.midp.io.protocol.http.HttpConnection.throwIOException(+8)
    at com.symbian.midp.io.protocol.http.HttpConnection.readLine(+54)
    at com.symbian.midp.io.protocol.http.HttpConnection.readStatusLine(+5)
    at com.symbian.midp.io.protocol.http.HttpConnection.getResponse(+10)
    at com.symbian.midp.io.protocol.http.HttpConnection.ensureResponse(+44)
    at com.symbian.midp.io.protocol.http.HttpConnection.getResponseMessage(+8)
    at example.http.HttpTest.readContents(+516)
    at example.http.HttpTest.commandAction(+34)
    at javax.microedition.lcdui.Displayable.commandAction(+29)
    at javax.microedition.lcdui.Toolkit.postEvent(+78)
    at com.symbian.midp.compatibility.runtime.KVMEventProcessor.run(+27)
    java.io.IOException: Unexpected end of stream

  6. #6
    Registered User
    Join Date
    May 2003
    Posts
    29

    connection path

    use the correct path

    http://localhost:8080/servlet/someServlet.class

    u should get it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •