There's a POST example in the DoJa-1.5 Developer's Guide, which is in English:
http://www.nttdocomo.com/corebiz/imode/why/guideline/javamanual.html
Make sure you add the following line to your JAM file to enable http:
UseNetwork = http
(And change the URL to point to the server that provided the JAM file!)
Looking for other examples online... The JXME project contains some
DoJa code. See the Chat app:
http://jxme.jxta.org/doja.html
The Keitai Wiki should be a good starting place. Help make it better:
http://www.keitai-dev.net/wiki
reks mk <haidhey@yahoo.com> wrote:
> Hi,
>
> I will put the query i asked in my last mail in a more
> precise manner.
> I want to post HTTP request parameters to a servlet by
> using an HttpConnection OutputStream.I am
>
> trying to simulate the upload of a web page form and
> extract request parameters at the servlet
>
> via request.getParameter(parm), but I can't seem to
> get it to work.
>
> Here is sample code:
>
> HttpConnection
> hc=(HttpConnection)Connector.open("http://localhost:8080/abc.jsp",Connector.READ_WRITE,true);
> hc.setRequestMethod(HttpConnection.POST);
> hc.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
> OutputStream out = hc.openOutputStream();
> byte[] data0;
> String Para;
> Para = "uid=" + t1.getText();
> data0 = Para.getBytes();
> System.out.println("val of"+Para);
> out.write(data0);
> out.close();
> hc.connect();
> hc.close();
> etc
>
> The servlet is properly called and run, but the value
> of the
> parms (para and data0) is null. Any suggestions?
> Thanks.
>
Received on Tue Jan 18 11:57:17 2005