SPRING CORE / CATATAN</>↗Spring Core20 Feb 2014
In this example you will learn how to access class-scoped methods or constants using Spring Expression Language. To access a class-scoped methods or constants you will need to use the T() operator of the Spring EL, for example T(java.lang.Math). This operator will give us the access to static methods and constants on a given class. […]
MAIL / CATATAN</>↗Mail02 Feb 2014
In this example you will learn how to receive email using POP3. We are going to connect to Gmail server and read the messages in the INBOX folder. There are some steps that you need to do to download this email. Here are the steps: Setup properties for the mail session. Creates a javax.mail.Authenticator object. […]
MAIL / CATATAN</>↗Mail19 Jan 2014
The code snippet below show you how to create a simple Java Swing application that can be used to send an e-mail. The program allows user to supply the from email address, to email address, the subject and the message of the email. User need to select the available SMTP server to connect to and […]
MAIL / CATATAN</>↗Mail17 Jan 2014
Here are a list of system properties that can be used to send an e-mail using the JavaMail API. Property Default Value Description mail.host Define the host name of the mail server. mail.smtp.host Define the host name of the SMTP server; this will overrides the mail.host for SMTP connections only. mail._protocol_.host Define the host name […]
MAIL / CATATAN</>↗Mail16 Jan 2014
The following code snippets show you how to send an HTML e-mail. We begin by defining the e-mail information such as the from address, to address and the subject. The next step it to create a Properties that will be used to create a mail Session object. Having a Session object we can then create […]
CORE API / CATATAN</>↗Core API18 Des 2013
In the following post you will learn how to read last n characters from a file. The JDK 7 introduces a new SeekableByteChannel interface which allows its implementation to change the position and the size of the byte channel. One of its implementation is the FileChannel class (java.nio.channels.FileChannel). The FileChannel class make it possible to […]