code: @Override
  	public void handleRequest(final Request request) {
  		if (clrBtn.isPressed()) {
  			textFld.setText("");
  		} else if (dupBtn.isPressed()) {
  			// Get the text entered by the user.
  			String text = textFld.getText();
  
  			// Now duplicate it.
  			textFld.setText(text + text);
  		}
  	}
docs: Control logic is implemented in the handleRequest method. This example checks if a button has been pressed, and
  duplicates/clears the text accordingly.
  
  @param request the current client request.