• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP in J2ME

 
Xinyi Zhang
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to use HTTP connection to communicate with JavaBeans in a web application? Thanks.
 
Jephix Liu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can write a servlet which accesses the beans on J2ME client's behalf.
 
iffat siddique
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can do this by using CLDC Generic Connection framework classes snap shot of doing so is.
//...............
String url="here come address of JSP ";
HttpConnection myconnection =(HttpConnection) Connector.open(url);
InputStream in =myconnection.openDataInputStream();
StringBuffer response=new
int ch;
while ((ch = in.read()) != -1) {
response.append((char)ch);
}
message=response.toString();
in.close();
hc.close();

///...............
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic