Archive for the ‘Tomcat’ Category

Serialization, Timezones and Java Dates

Saturday, June 6th, 2009

Timezone has not been kept while transfering over http.

The data are stored in the tableModel on the client side. TableModel is serialized and sent over the http to the server. The servlet on the server deserializes the data into the tableModel. TableModel is stored into the database.

My client is located in the central Europe and the server is located in the USA. The client time was Jun 06 00:00:00 CEST 2009. The data was transferred over the http and the same date on the server was Jun 05 17:00:00 CDT 2009.

Solution:

I set GMT timezone on both sides.

TimeZone tz = TimeZone.getDefault();
tz.setDefault(TimeZone.getTimeZone(“GMT”));

The client and the server date time are the same after setting default timezone: Jun 06 00:00:00 GMT 2009.

 Do not hesistate to check out a hotel reservation software using the described technology.
 

 

Java Swing application comunicates over http with application server and database

Sunday, May 3rd, 2009

This is the announcement for version 1.0 of Hotel Reservation software written in java. Application is multilanguage but it is still poorly translated at the moment. Main functionality has been translated into English and some other languages. It could be translated to other languages of course if somebody needs it. Application was originally developed in Slovenian language so you could expect to find out some fields which has not been translated yet.

I mixed different technologies in this application: swing, servlets, tomcat and mysql. The entire application is written in swing, it comunicates over http using servlets with the application server, servlets communicate over the jdbc with the database. I plan to describe particular parts of the application in more details in the following days.

You can launch a demo at http://javanus.com/AssistWeb/. The picture below presents basic steps to create your first reservation.

Application works fine as a desktop application which communicate with the database using jdbc at the moment. Please send me an email to info at javanus.com if you would like to test it a desktop version.