aspose file tools*
The moose likes Java Micro Edition and the fly likes How to send request to Servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "How to send request to Servlet?" Watch "How to send request to Servlet?" New topic
Author

How to send request to Servlet?

chetan dhumane
Ranch Hand

Joined: Jan 07, 2009
Posts: 629

How to send bytearray to Servlet and back to j2me client ?


http://www.androcid.com/
lokesh jain
Ranch Hand

Joined: Feb 21, 2009
Posts: 58
For that you need contact of Javascript or JSP with Servlet. From JSP if you take some input and then convert it into byte array then you can pass it to Servlet using Java Script.
chetan dhumane
Ranch Hand

Joined: Jan 07, 2009
Posts: 629

Thanks.

Can you answer this query http://www.coderanch.com/t/445672/Java-Micro-Edition/Mobile/Update-jar-automatically
Syam Sathyan George
Ranch Hand

Joined: Apr 26, 2006
Posts: 64
Lokesh have you understood the question fully?
He is asking how to send a byte array from j2me client to servlet and vice versa.
So i think its better not to refer javascript and jsp here

Chetan,

In Client
Open an HttpConnection (Connector.open and cast it to an HttpConnection)
1,Open the output stream and write your byte array.

In Server
get the request.servletInputStream
read the contents


Syam.Sathyan.George
(My boss is a Jewish carpenter)
chetan dhumane
Ranch Hand

Joined: Jan 07, 2009
Posts: 629

Thanks syam I have succeeded in that but now my query is different just above your post .
I have given the URL.
Syam Sathyan George
Ranch Hand

Joined: Apr 26, 2006
Posts: 64
Will get back tomorrow
chetan dhumane
Ranch Hand

Joined: Jan 07, 2009
Posts: 629

Hurray I found the solution. You can refer this link as the solution to this problem.
Solution
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to send request to Servlet?