private Sender getPublicRelationsSender() { for (final Sender sender : Sender.getAvailableSenders()) { if (sender.getFromName().equalsIgnoreCase("Gabinete de Comunica��o e Rela��es P�blicas")) { return sender; } } return null; }
@EntryPoint public ActionForward newEmail( ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) { EmailBean emailBean = getRenderedObject("emailBean"); if (emailBean == null) { emailBean = (EmailBean) request.getAttribute("emailBean"); } if (emailBean == null) { emailBean = new EmailBean(); final Set<Sender> availableSenders = Sender.getAvailableSenders(); if (availableSenders.size() == 1) { emailBean.setSender(availableSenders.iterator().next()); } } RenderUtils.invalidateViewState(); request.setAttribute("emailBean", emailBean); return mapping.findForward("new.email"); }