All entries by this author

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 [...]



Spring 3.0 – Java Annotation based Dependency Injection(DI)

Jan 19th, 2010 | By admin | Category: Spring

If you have been using Spring Framework for sometime , you will be aware that the Spring Framework has undergone several major changes in the latest Spring version 3.x. Spring Framework is now based on Java 5 and Java 6 fully supported. It has incorporated all the important features of Java latest versions. Spring version 3.0 encourages the developers to use Java Annotations instead of the configuration xml. This post will talk on the Annotation based Dependency Injection mechanism using Spring 3.0.



Protecting web application from Path Traversal Attack

Jan 4th, 2010 | By admin | Category: Web Technologies

A Path Traversal attack targets the files and directories which are saved outside the root folder. An attacker aims for a files path stored in the web server. An attacker use the combination of dot-dot-slash(../) to browse to arbitrary directories and files. The dot-dot-slash sequence helps an attacker to move up in any directory location. The attacker not only can access any arbitrary files/directories from your web server , it is possible to upload some malicious files to some location in your web server , if the proper care is not taken.



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.



Spring DAO – JDBC Support

Dec 15th, 2009 | By admin | Category: Spring

Spring framework has a full-fledge support for the Database Access Objects(DAO). Spring’s support of DAO is not limited with the relational database like MySQL , Oracle , etc . It has support for Object Relational Databases like , HSQL , JDO etc. Whan I talk about suppot it means a lot of things.

Before going into the details , let us ask a question to ourselves .What is the real problem in coding a JDBC without a framework support ?



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.



Dependency Injection Concept

Nov 30th, 2009 | By admin | Category: Spring

Java classes and objects should be as much as possible loosely coupled with other java classes and objects. The loosely-coupled behavior allows a Java code to be re-usable ,test-worthy , modular and well maintained. Often , A class depends on another class and arise the coupling .

Dependency Injection(DI) mechanism helps to introduce the loose coupling which makes your code more modular and testable.

The container which supports this dependency injection concept is called the IOC (Inversion of control) Container. Spring uses the concept of IOC and dependency injection to locate and inject services for you.

Read more to know more



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.