Hi,
I�m testing the app on the simulator and I�m using the latest version of the j2mewkt 1.0.3 with jdk 1.3.1
To monitorize the process I�m using window�s task administrator. Here is my code sample:
public
String sendGetRequestOutput()
{
//variables
String parametros="";
DataInputStream iStrm =null;
//sacamos parametros de la hash para montar la url
try
{
if (htParam != null)
{
Enumeration eClaves = htParam.keys();
while (eClaves.hasMoreElements())
{
String clave = (String)eClaves.nextElement();
String value = (String)htParam.get(clave);
parametros += clave + "=" + value + "&";
}
parametros = parametros.substring(0,parametros.length()-1);
}//if
}// try
catch (Exception e)
{
System.out.println("[SetHttpConnection] Error al extraer datos de tabla hash: " +e);
}
if (url.equals(""))
{
url=URL;
}
try
{
url += servletName + "?" + parametros;
http = (HttpConnection)Connector.open(url);
http.setRequestMethod(HttpConnection.GET);
http.setRequestProperty("User-Agent","Profile/MIDP-1.0 Configuration/CLDC-1.0" );
http.setRequestProperty("Accept","text/plain");
iStrm = http.openDataInputStream();
if (http.getResponseCode()== HttpConnection.HTTP_OK)
{
StringBuffer b = new StringBuffer();
int ch;
while ((ch = iStrm.read()) != -1)
{
b.append((char) ch);
}
return b.toString();
}
else
{
return null;
}
}//try
catch(Exception e)
{
return null;
}
finally
{
try
{
if (http != null)
{
http.close();
}
if (iStrm != null)
{
iStrm.close();
}
}
catch(Exception e)
{
System.out.println("[SetHttpConnection] Error al cerrar conexion http " +e);
}
}
}
Please help me,
thanks.