Posts Tagged ‘ Java ’

Developing GWT-RPC application with a Database support

Jun 25th, 2010 | By admin | Category: GWT, Web Technologies

This post is a step-by-step guide to build an application using GWT-RPC . Just to make it more realistic , I have used a back-end database to store the records. I have used MySql as a database and Tomcat 6.0 as a deployment web server. If you are interested to have a look at the code and then the post , it can be downloaded from here. Let me start with a small but specific description of GWT-RPC.



GWT – How to create a HTML Label

Jun 14th, 2010 | By admin | Category: GWT

GWT provides a text-type label by default. You can set a text to a label but it is not possible to set a HTML to a Gwt label unless you do few changes.

Label myLabel = new Label();
myLabel.setText("This is my label");
myLabel.setHtml("This<br>is<br>my<br>label"); // compilation error

To achieve this , you can create your own customized label which [...]



Creating a Temporary File

Dec 22nd, 2009 | By admin | Category: Java

We use temporary file in our day to day applications. This post would talk on how to create a temporary file using Java Programming language. Java gives us a direct API to create a temporary file with some options.

A temporary file can be created depending on certain condition and can be closed and deleted depending on some condition. For an example, lets assume we can upload and install a plug-in(a file) on an application.



Integrate any J2EE-based web application with Spring

Dec 3rd, 2009 | By admin | Category: Spring

Spring is a very good modular framework. Each module of the framework can be used depending on the various need in an application. Lets take an example of a J2EE-based web application which can use Spring-DAO module for it’s data base layer or Spring-MVC to make the navigation between Model-View-Controller more modular and testable.
But , there might be a situation where Spring-MVC is not your need , rather you would like to take advantage of Spring-DAO module along with normal servlets and jsps. What to do then ?



Setter Injection – Type of Dependency Injection

Dec 2nd, 2009 | By admin | Category: Spring

I have discussed on the concept of Dependency Injection in my last post . This post is about a specific type of Dependency Injection adopted by Spring. It is called Setter Injection. In Java POJO(Plain old java object) world , setters and getters are very common terms. A setter which sets an attribute value of a class. A getter which return the attribute value of a class.



Story behind start() and run() methods of Java Thread

Nov 27th, 2009 | By admin | Category: Java

The basic concept of creating a java thread is to extend the class java.lang.Thread or to implement java.lang.Runnable interface. In both the cases , implementation of run() method is mandatory for your thread to be a meaningful Thread.

The run() method is the most important method in the thread classes, it is also the only method that we need to implement in both cases. Why it’s only proper to call the start() method to start the thread instead of calling the run() method directly? What are the problems if we do so ?

Click below to have a look at the detail explanation.



Version Control in Java Serialization – serialVersionUID

Aug 6th, 2009 | By admin | Category: Java

In my last post on java object serialization , I have explained how to write an object to an object stream and how to read the object state under a different java virtual machine. Lets assume, we have created a class and instantiated it and serialized(Written the state to the file system) it too. Now [...]



Simple way to Write to XML using Java

Jul 30th, 2009 | By admin | Category: Java

Often it becomes necessary for application programmer to read from or write to XML pragmatically. There are many different ways to deal with XML using Java programming language. I am going to share one of them. Let me start this post with an use case. While reading through the use case , we should learn how to use Java to write to XML file. Lets Start . . .



Refresh GUI on XML update without restarting Tomcat(Server)

Jul 20th, 2009 | By admin | Category: Servlets

I am writing this post on the basis of my learning on refreshing UI(User interface) without restarting server(Tomcat , in my case) on update of an XML which resides inside the container. Often we follow the design where we write our application configuration into an XML file and read – write the XML based on the requirements.



Java Object Serialization – Developer’s Guide

Jul 16th, 2009 | By admin | Category: Java

Class is the heart of Java programming and object is a representative of the class. In day to day java programming , we create object and use that in different way.But the life span of an object is till the JVM(Java Virtual Machine) is up. Once JVM is down , there is no existence of the object you have created.But Java has a mechanism which allows you to store(save) your object ( let me say, object state) and you can use the stored object under a different JVM , in a different application or after restarting your own JVM. Isn’t it cool ? Read this post to start with Java Serialization API.