Posted By:
Miguel_Jaime
Posted On:
Friday, March 30, 2007 06:57 AM
How can i connect a MIdlet to a servlet so the parameters can be sent by the servlet to the database? I have a Registration code that I wish to connect ot my servlet though I do not know what parameters to enter in order to make it work , can anyone help me please, thank you /* * Registration.java * * Created on 28 February 2007, 19:14 */ import javax.microedition.midlet.*; import javax.microedition.lcdui.*; /** * * @author user n104-16 */ public class Registration extends MIDlet { private Display display; private TextField userName; private TextField password; priv
More>>
How can i connect a MIdlet to a servlet so the parameters can be sent by the servlet to the database?
I have a Registration code that I wish to connect ot my servlet though I do not know what parameters to enter in order to make it work , can anyone help me please, thank you
/*
* Registration.java
*
* Created on 28 February 2007, 19:14
*/
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
*
* @author user n104-16
*/
public class Registration extends MIDlet {
private Display display;
private TextField userName;
private TextField password;
private TextField email;
private TextField oyster;
private Form form;
private Command cancel,submit;
public Registration() {
userName = new TextField("LoginID:", "", 10, TextField.ANY);
password = new TextField("Password:", "", 10, TextField.PASSWORD);
email = new TextField("Email","",10,TextField.EMAILADDR);
oyster = new TextField("Oyster number","",10,TextField.ANY);
form = new Form("Registration");
cancel = new Command("Cancel", Command.CANCEL, 2);
submit = new Command("Submit",Command.SCREEN,1);
//login = new Command("Login", Command.OK, 2);
}
//GEN-LINE:MVDFields
//GEN-LINE:MVDMethods
/** This method initializes UI of the application.//GEN-BEGIN:MVDInitBegin
*/
private void initialize() {//GEN-END:MVDInitBegin
// Insert pre-init code here
//GEN-LINE:MVDInitInit
// Insert post-init code here
}//GEN-LINE:MVDInitEnd
/**
* This method should return an instance of the display.
*/
public Display getDisplay() {//GEN-FIRST:MVDGetDisplay
return Display.getDisplay(this);
}//GEN-LAST:MVDGetDisplay
/**
* This method should exit the midlet.
*/
public void exitMIDlet() {//GEN-FIRST:MVDExitMidlet
getDisplay().setCurrent(null);
destroyApp(true);
notifyDestroyed();
}//GEN-LAST:MVDExitMidlet
public void startApp() {
display = Display.getDisplay(this);
form.append(userName);
form.append(password);
form.append(email);
form.append(oyster);
form.addCommand(cancel);
form.addCommand(submit);
//form.addCommand(login);
//form.setCommandListener(this);
display.setCurrent(form);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command c, Displayable d) {
}
}
Please use html tags to format code blocks.
<<Less