hi guys,

i have a connection class which will communicate with a server. i'm using Nokia NFC 6131 and Nokia NFC 3212 classic phone.

this is the connection class


public class Connection extends Thread {

private HttpConnection httpConnection;
private DataInputStream inputStream;
private String total;
private StringBuffer sb;
private String url;
public static String requestValue;
CommonMethods common = new CommonMethods();
Navigation nav = new Navigation();

public void run() {
try {
// System.out.println(requestValue);
if (requestValue.equals(Constants.MOBILE_LOGIN)) {
total = URLEncoder.encode(Login.tot, "UTF-8");
}
if (requestValue.equals(Constants.MOBILE_SCHEDULE)) {
total = URLEncoder.encode(Menu.tot, "UTF-8");
}
if (requestValue.equals(Constants.TASK_DETAILS)) {
total = URLEncoder.encode(TaskList.tot, "UTF-8");
}
if (requestValue.equals(Constants.MOBILE_SAVE_TAG_LOG)) {
total = URLEncoder.encode(DutyEvent.tot, "UTF-8");
}
if (requestValue.equals(Constants.MOBILE_UPDATE_TAG_LOG)) {
total = URLEncoder.encode(DutyEvent.tot, "UTF-8");
}
url = Constants.URL + Constants.parameter + total;
// common.errorDialog("URL", url);
System.out.println("URL:" + url);
try {
httpConnection = (HttpConnection) Connector.open(url, Connector.READ_WRITE, true);
} catch (SecurityException e) {
common.errorDialog(e.getMessage(), "Restart Application");
return;
}
if (httpConnection.getResponseCode() == HttpConnection.HTTP_OK) {
inputStream = httpConnection.openDataInputStream();
sb = new StringBuffer();
int ch;
while ((ch = inputStream.read()) != -1) {
sb.append((char) ch);
}
nav.connectionResults(sb.toString().trim(), requestValue);
} else {
common.errorDialog("Connection2", "Connection Failed");
}
} catch (IOException ex) {
nav.connectionResults(Constants.CONNECTION_FAILED, requestValue);
} finally {
if (httpConnection != null) {
try {
httpConnection.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
}
}
the porblam is in 6131 phone the app works fine. but in 6212 for it always throws the 404 exception. when i put a system.out
it displays as

HTML Code:
http://xxx:9090/trackr/MobileIntegration?&msg=garin-%-garin-%-1
but the corect url should be

HTML Code:
http://xxx:9090/trackr/MobileIntegration?&msg=garin-%40-garin-%40-1
and when i debug the application the url variable displays the correct value

i'm soo confused with this. even the results in the emulator is coming correctly as expected but in the phone it's not.

so could you guys give me a reason and suggestions

regards,
Randika