| Author |
HttpConnection
|
Dilip Kulkarni
Greenhorn
Joined: Jan 29, 2006
Posts: 5
|
|
|
When I use requestMethod as HttpConnection.GET or HttpConnection.POST I get Method not supported Exception in J2ME 2.2 Emulator. Please give the solution.
|
Dilip
|
 |
payal agrawal
Ranch Hand
Joined: Oct 11, 2005
Posts: 44
|
|
Look at the URL below; How to implement networking on mobile devices http://www.java-tips.org/content/view/753/73/
|
 |
Dilip Kulkarni
Greenhorn
Joined: Jan 29, 2006
Posts: 5
|
|
|
Thanks for reply. I have similar code. It builds fine , but when I try to send data or upload file on tomcat server through Emulator I get IOException Method not supported HttpConnection.GET
|
 |
payal agrawal
Ranch Hand
Joined: Oct 11, 2005
Posts: 44
|
|
The code should support MIDP1.0 and CLDC1.0 profile.Though there are no specific API permission to set, you should be able to run it successfully. Below are the links to send data to tomcat server through MIDLet.I havent tried uploading file.But this works fine in emulator 2.2 Sending data to Servlet and getting the response http://www.java-tips.org/content/view/537/73/
|
 |
Dilip Kulkarni
Greenhorn
Joined: Jan 29, 2006
Posts: 5
|
|
Thanks a lot ! It worked. The mistake, I was doing, setting requestMethod before setting requestProperty "User-Agent"
|
 |
Seetesh Hindlekar
Ranch Hand
Joined: Feb 13, 2004
Posts: 244
|
|
The sample code posted in www.java-tips.org/content/view/753/73/ throws this Exception startApp threw an Exception java.lang.NullPointerException java.lang.NullPointerException at httpMIDLET.getData(+162) at httpMIDLET.startApp(+8) at javax.microedition.midlet.MIDletProxy.startApp(+7) at com.sun.midp.midlet.Scheduler.schedule(+270) at com.sun.midp.main.Main.runLocalClass(+28) at com.sun.midp.main.Main.main(+116) Rgds, Seetesh
|
 |
 |
|
|
subject: HttpConnection
|
|
|