Examples of WebHelper


Examples of br.com.msi.util.WebHelper

    }

    public void logarVisitante() {
        try {

            if (ipsBloqueadosSBeanLocal.ipEstaBloqueado(new WebHelper().getRemoteAddr())) {
                warn("Você foi bloqueado de utilizar o site!");
            }else if (chatVisitantes.contains(visitantes)) {
                warn("Já contém um visitante com este login! Por informe outro login.");
            }else if(StringHelper.verificarCaracteresInvalidos(visitantes.getNomeVisitante(), StringHelper.CARACTERES_INVALIDOS)){
                warn("O campo nome contem caracteres inválidos, favor retirar o(s) mesmo(s)!");
            } else {
                HttpServletRequest req = (HttpServletRequest) getExternalContext().getRequest();
                if (!RegexHelper.validate(visitantes.getEmail(), RegexHelper.EMAIL_PATTERN)) {
                    throw new MensagemException("Email inválido! Por favor insira um email como neste exemplo: jack@gmail.com", Constants.MSG_ALERT);
                }
                gerarIdUnique();
                String ip = new WebHelper().getRemoteAddr();
                visitantes.setIdVisitante(null);
                visitantes.setLoginVisitante(StringHelper.getStringSemEspaco(visitantes.getLoginVisitante()));
                visitantes.setBrowser(req.getHeader("User-Agent"));
                visitantes.setDataHoraVisita(new Date(System.currentTimeMillis()));
                visitantes.setIpVisitante(ip);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.