jsTree e jQuery

Pesquisar este blog

Contribua

Te ajudei? Quer retribuir? PIX de qualquer quantia.

PrimeFaces 5.1 - CommandButton - Ícone personalizado

Segue como eu consegui colocar uma imagem (ícone) no botão do primefaces, ou seja, componente CommandButton.

Os meus arquivos (default.css e cabecalho.png) estão nas seguintes pastas.


CSS (default.css)
.cabecalho {
    background-image: url('../imagens/cabecalho.png') !important;
}

XHTML

<h:head>
    <link href="${facesContext.externalContext.requestContextPath}/resources/css/default.css" 
          rel="stylesheet"
          type="text/css" />
</h:head>
<h:body>

    <p:commandButton type="push" 
                     title="Editar cabeçalho" 
                     icon="cabecalho" />    
</h:body>

Não esqueça de limpar o cache do seu navegador.





JavaMail (1.5.2) Enviar Email Autenticado Não SSL

Baixe o arquivo javax.mail.jar em
https://java.net/projects/javamail/

Por exemplo, versão 1.5.2
https://java.net/projects/javamail/pages/Home#Download_JavaMail_1.5.2_Release

Adicione o arquivo javax.mail.jar ao seu projeto.

Usando

        String emails_para[] = new String[]{"email1@provedor.br", "email2@provedor.br"};
        
        try {
            CorreioEletronico.EnviarEmail(emails_para, "Assunto", "mensagem");
        } catch (MessagingException ex) {
            Logger.getLogger(TesteEmail.class.getName()).log(Level.SEVERE, null, ex);
        }


Enviar um e-mail autenticado sem SSL (Secure Socket Layer).

import java.util.*;
import javax.mail.*;
import javax.mail.Message.RecipientType;
import javax.mail.internet.*;

public class CorreioEletronico {
    //Por exemplo, smtp.ig.com.br
    private static final String MAIL_SMTP_HOST = "smtp.provedor.com.br"; 
    
    private static final int    MAIL_SMTP_PORT = 587;                    
    
    //Por exemplo, welgomes@ig.com.br
    private static final String MAIL_FROM = "emailde@provedor.br";
    
    //Como usuário geralmente é usado o próprio e-mail, por exemplo, welgomes@ig.com.br
    private static final String MAIL_SMTP_USER = "emailde@provedor.br";
    private static final String MAIL_SMTP_PASSWORD = "suasenha";
    private static final String MAIL_TRANSPORT_PROTOCOL = "smtp";
        
    public static void EnviarEmail( String emails_para[]
                                  , String assunto
                                  , String mensagem
           throws MessagingException
                , AddressException
                , javax.mail.MessagingException{
        
        //Set the host smtp address
        Properties props = new Properties();        
        props.put("mail.smtp.auth", true);
        props.put("mail.smtp.starttls.enable", true);                
        
        props.put("mail.smtp.host", MAIL_SMTP_HOST);
        props.put("mail.smtp.localhost", MAIL_SMTP_HOST);
        props.put("mail.smtp.user", MAIL_SMTP_USER);
        props.put("mail.smtp.password", MAIL_SMTP_PASSWORD);
        props.put("mail.smtp.port", MAIL_SMTP_PORT);                
        props.put("mail.transport.protocol", MAIL_TRANSPORT_PROTOCOL);
        
        // create some properties and get the default Session                
        Session session = Session.getDefaultInstance(props, null);
        
        boolean debug = false;
        session.setDebug(debug);
        
        // create a message
        MimeMessage msg = new MimeMessage(session);
        
        // set the from and to address
        InternetAddress addressFrom = new InternetAddress(MAIL_FROM);
        msg.setFrom(addressFrom);
        
        InternetAddress[] addressTo = new InternetAddress[emails_para.length]; 
        
        for (int i = 0; i < emails_para.length; i++){
            addressTo[i] = new InternetAddress(emails_para[i]);
        }//end for
        
        msg.setRecipients(RecipientType.TO, addressTo);
        
        // Optional : You can also set your custom headers in the Email if you Want
        //msg.addHeader("MyHeaderName", "myHeaderValue");
        
        // Setting the Subject and Content Type
        msg.setSubject(assunto);
        msg.setContent(mensagem, "text/plain");
        
        //Transport.send(msg);        
        Transport transport = session.getTransport(MAIL_TRANSPORT_PROTOCOL);
        transport.connect (MAIL_SMTP_HOST, MAIL_SMTP_PORT, MAIL_SMTP_USER, MAIL_SMTP_PASSWORD);
        transport.sendMessage(msg, msg.getAllRecipients());
        transport.close();    

    }//end method

}//end class



Creeper World 3: Arc Eternal

No Steam você tem que pagar por este jogo.

Porém no Kongregate você joga de graça.
http://www.kongregate.com/games/whiteboardwar/creeper-world-3-abraxis

A Culpa é...

Esse negócio de um culpar o outro só leva a guerra. 
Tem que parar de demagogia e cada um fazer sua parte. 
Quando era representante de sala na faculdade um grupo de alunos queria ferrar com o professor por causa das notas baixas, então questionei se eles leram a apostila, fizeram todos exercícios e se a presença nas aulas estavam em dia, eles recuaram imediatamente.