// Lookup customer based on request parameter 'customerId'
String customerId = getContext().getRequest().getParameter("customerId");
Customer customer = customerService.findCustomerByID(customerId);
// CustomerPanel will render the customer as an HTML snippet
CustomerPanel customerPanel = new CustomerPanel(this, customer);
actionResult.setContent(customerPanel.toString());
// Set content type and character encoding
actionResult.setCharacterEncoding("UTF-8");
actionResult.setContentType(ActionResult.HTML);