- http://wicket.apache.org/
- http://blog.brunoborges.com.br/search/label/Wicket
- http://cwiki.apache.org/WICKET
Struts2:
Blog que reune assuntos que devem ser lembrados as vezes e que quando se precisa parece que a memória prega uma peça.
package mailsender;
import javax.mail.*;
import javax.mail.internet.*;
public class Main {
public static void main(String[] args) throws Exception {
String smtpHost = "";
String smptPort = "";
String smtpUser = "";
String smtpPassword = "";
MailSender ms = new MailSender(smtpHost, smtpPort, smtpUser, smtpPassword);
ms.send("diego.ziquinatti@ecore.com.br", "Hello", "Testando email");
System.out.println("Enviado com sucesso!");
}
static class MailSender {
private String smtpHost;
private String smtpPort;
private PopupAuthenticator authenticator;
public MailSender(String smtpHost, String smtpPort, String smtpUser, String smtpPassword) {
this.smtpHost = smtpHost;
this.smtpPort = smtpPort;
authenticator = new PopupAuthenticator(smtpUser, smtpPassword);
}
public void send(String to, String subject, String content) throws AddressException, MessagingException {
// Create a mail session
java.util.Properties props = new java.util.Properties();
props.put("mail.smtp.host", smtpHost);
props.put("mail.smtp.port", smtpPort);
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.user", "login");
props.put("mail.smtp.password", "password");
// Create the session object
Session session = Session.getDefaultInstance(props, authenticator);
// Construct the message
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(authenticator.getUser()));
msg.setRecipient(Message.RecipientType.TO, new InternetAddress(to));
msg.setSubject(subject);
msg.setText(content);
// Send the message
Transport.send(msg);
}
}
static class PopupAuthenticator extends Authenticator {
private String user;
private String password;
public PopupAuthenticator(String user, String password) {
this.user = user;
this.password = password;
}
@Override
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(getUser(), getPassword());
}
public String getUser() {
return user;
}
public String getPassword() {
return password;
}
}
}
Byte (1 char) = 8 bits
Kilobyte (KB) = 1 000 bytes
Megabyte (MB) = 1 000 000 bytes
Gigabyte (GB) = 1 000 000 000 bytes
Terabyte (TB) = 1 000 000 000 000 bytes
Petabyte (PB) = 1 000 000 000 000 000 bytes
Exabyte (EB) = 1 000 000 000 000 000 000 bytes
Zettabyte (ZB) = 1 000 000 000 000 000 000 000 bytes
Yottabyte (YB) = 1 000 000 000 000 000 000 000 000 bytes