if (customer == null) {
FacesContext facesContext = FacesContext.getCurrentInstance();
String customerId = facesContext.getExternalContext().getRequestParameterMap().get(PARAM_NAME_CUSTOMER_ID);
String elExpression = "customerService";
CustomerService customerService = (CustomerService) facesContext.getApplication().getELResolver().getValue(
facesContext.getELContext(), null, elExpression);
try {
customer = customerService.getCustomer(Long.parseLong(customerId));
}
catch (NumberFormatException e) {
logger.error(e);
}
}