CORE API / CATATAN</>↗Core API28 Mar 2006
To check if a file, or a directory exists we can utilize java.io.File.exists() method. This method return either true or false. Before we can check whether its exists or not we need to create an instance of File that represent an abstract path name of the file or directory. After we have the File instance […]
CORE API / CATATAN</>↗Core API23 Mar 2006
In the code snippet below we are going to learn how to use the System.arraycopy() method to copy array values. This method will copy array from the specified source array, starting from the element specified by starting position. The array values will be copied to the target array, placed at the specified start position in […]
CORE API / CATATAN</>↗Core API22 Mar 2006
In an application we sometimes want to terminate the execution of our application, for instance because it cannot find the required resource. To terminate it we can use exit(status) method in java.lang.System class or in the java.lang.Runtime class. When terminating an application we need to provide a status code, a non-zero status assigned for any […]
SERVLET / CATATAN</>↗Servlet18 Mar 2006
I have created a servlet based web application, and I want to used Spring beans in it. So how do I do this in my servlet. Well, it is simple enough to do this. First, I have to obtain the Spring’s WebApplicationContext, from where I can grab the required bean by my servlet. Let’s see […]
APACHE COMMONS / CATATAN</>↗Apache Commons17 Mar 2006
The toString() method defined in the java.lang.Object can be overridden when we want to give more meaningful information about our object. We can simply return any information of the object in the toString() method, for instance the value of object’s states or fields. The Apache Commons Lang library offers a good utility for creating this […]
SERVLET / CATATAN</>↗Servlet15 Mar 2006
When you have a web application you might want to know how many users are currently online or connected to your website. If you have visited some web online forums you can see; usually on the first page; the list of their online users or maybe just the number of currently online users. How do […]