• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to send request to Servlet?

 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to send bytearray to Servlet and back to j2me client ?
 
lokesh jain
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.

Can you answer this query http://www.coderanch.com/t/445672/Java-Micro-Edition/Mobile/Update-jar-automatically
 
Syam Sathyan George
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will get back tomorrow
 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hurray I found the solution. You can refer this link as the solution to this problem.
Solution
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic