Posts

Showing posts from December, 2011

How to enable SSL on apache Tomcat 7.0

Image
This tutorial shows how to enable SSL support for Apache Tomcat web server. Requirement *) Apache Tomcat 5.0 *) JDK 1.5 Note: if you have JDK below 1.4, you need to install Java Secure Socket Extensions (JSSE) To install and configure SSL support on Tomcat, you need to follow these simple steps. Generating the KeyStore file: *) Create a keystore file to store the server's private key and self-signed certificate by executing the following         command. *) Enter command line and change directory to your JAVA\bin folder. (Default path is: C:\Program         Files\Java\jre6\bin). *) Type “keytool –genkey –alias tomcat –keyalg RSA" and press Enter.         Where tomcat is an alias name and RSA is a key algorithm. *) Type your password for the keystore. (Default password is: changeit). In this example, I’ll use password as “password" Enter general information about this Certificate. The example is the image be...

Java Date, Calendar and Time API - Tutorial

The Calendar class’ date/time API is a nifty tool for accurately manipulating date and time values without too much stress or custom coding. It provides direct support for time based objects. This article gives a few examples how this API can be used. . The class java.util.Date was the first implementation which was used for manipulating dates. The class java.util.Calendar was added in Java 1.1 and provides simplified access to storing and manipulating dates. It is recommended to use Calendar if possible. In reality you have to convert frequently from Date to Calendar and vice versa, e.g. during database access you often get a java.sql.Date object. The following explains how to use Calendar and how to convert Dates into Calendar. It also offers a set of methods for converting and manipulating temporal information. In addition to retrieving the current date and time, the Calendar class also provides an API for date arithmetic. The API takes care of the numerous minor adjustments t...