File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java Micro Edition and the fly likes HttpConnection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "HttpConnection" Watch "HttpConnection" New topic
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HttpConnection
 
Similar Threads
Posting to bump up my count...
Text box value is not being completely filled with request attribute
WA #1.....word association
Cant use object from another class
The x900 effect ?