ActionListener
actionPerformed()
input.getText()
BufferedReader
output.setText()
doGet()
Hello, Bill
Hello, whoever you are
http://localhost:8080/getter.html
implements ActionListener
init()
button.addActionListener(this);
public void actionPerformed(ActionEvent event){ //deal with the event }
URL url = new URL(getCodeBase(),"/servlet/Greeter?name=" + name); URLConnection conn = url.openConnection(); conn.setUseCaches(false);
name
InputStream is = conn.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(is));String reply = reader.readLine(); is.close();