SERVLET / CATATAN</>↗Servlet23 Des 2006
In a web application there are different type of scope where we can store object or data. There are a page, request, session and application scope. To share data between users of the web application we can put a shared object in application scope which can be done by calling setAttribute() method of the ServletContext. […]
CORE API / CATATAN</>↗Core API22 Des 2006
In the DateFormat class there are some predefined constants that we can use to format a date time value. Here is an example of it. package org.kodejava.text; import java.text.DateFormat; import java.util.Date; public class DefaultDateFormatExample { public static void main(String[] args) { Date date = new Date(); // Format date in a short format String today […]
CORE API / CATATAN</>↗Core API20 Des 2006
Formatting how data should be displayed on the screen is a common requirement when creating a program or application. Displaying information in a good and concise format can be an added values to the users of the application. In the following code snippet we will learn how to format a date into a certain display […]
SERVLET / CATATAN</>↗Servlet16 Des 2006
This code helps you to get the physical path where your web application is deployed on the server. It may be useful, so you can for instance read or write files on the server. Please be aware that this method will only work when your web application is deployed in an exploded way, if it […]
CORE API / CATATAN</>↗Core API16 Des 2006
package org.kodejava.util; import java.text.DateFormatSymbols; import java.util.Calendar; public class LastDayOfMonth { public static void main(String[] args) { // Get a calendar instance Calendar calendar = Calendar.getInstance(); // Get the last date of the current month. To get the last date for a // specific month you can set the calendar month using calendar object // calendar.set(Calendar.MONTH, […]
CORE API / CATATAN</>↗Core API14 Des 2006
You want to know what is the last date for a current month. The code below show you how to get it. package org.kodejava.util; import java.util.Calendar; public class LastDateOfMonth { public static void main(String[] args) { // Get a calendar instance Calendar calendar = Calendar.getInstance(); // Get the last date of the current month. To […]