Archive for June, 2007





Learn the Servlet API – ServletRequest and HttpServletRequest

Posted on June 22nd, 2007 in Java EE, SCWCD, Tutorials | 1 Comment »

We will now concentrate on the basic aspect of using a Servlet which is requests and response. But we will currently concentrate only on ServletRequest and HttpServletRequest.

Points to Ponder: 

  • ServletRequest is not in any way responsible for fetching HTTP related properties.
  • ServletRequest and HttpServletRequest both are interfaces and you cannot directly use them.
  • The interface implementations depend on the vendor and not on the developer.

ServletRequest 

Lets look at the methods present in the ServletRequest Interface first and categorize them. There are in total 29 methods. For making the categories first we would have to look as to what are things to carry out when we receive a request. The things we would like to do are: Read the rest of this entry »

Learn the Servlet API – A step by step approach

Posted on June 21st, 2007 in Java EE, SCWCD, Tutorials | No Comments »

The SCWCD(Sun Certified Web Component Developer) exam concentrates on the Servlet API version 2.4.  In order to prepare for the exam its a necessary step to consider to learn the API itself. Learning the API means getting a knowledge about which Interfaces and which Classes exists. Their inheritance relationships and the methods associated with them. This actually helps a person in getting more confident while preparing for the exam since knowledge of the API makes it easy to recognize the errors and exceptions which may occur while using any of the interfaces or classes. It also helps to track the usage of syntaxes when codes are mentioned in the exam and how do they work.

So its in my mind to put forward the API in depth but not make it boring to read (Has anyone ever considered to read the API docs?). So the plan is to learn it in a step by step approach taking into mind the exam related topics!

So here we go. Read the rest of this entry »

Design Patterns – Building blocks for your application

Posted on June 10th, 2007 in Concepts | 5 Comments »

What is a pattern?

A pattern in short is a time and tested answer to a specific problem. When the design phase for an application starts a group of analysts sit with the developers to discuss about the requirements and come out with a proposal for a design.

The design thus formed is always taken care for being not only useful for the current set of requirements but also for the future.Any assumptions that can become realities in the future are introduced right in the beginning so that there is not much change involved in the code if it actually happens. Care is taken to make it as modular as possible to be easier to work with.

How do patterns come into being?

Patterns help in such design making decisions so that the design is ready in lesser time and there is not much apprehension that it would turn out wrong. This is because patterns are nothing but the outcomes of the problems we frequently face. Someone somewhere might have had faced a problem which made him/her to arrive at a solution which was tested and proved successful.

Such solutions when spread Read the rest of this entry »

The Struts Framework – Why choose it?

Posted on June 3rd, 2007 in Java, Java EE | 14 Comments »

Struts is a J2EE web application framework created and maintained by Apache Software Foundation Group (ASF). It is a controller framework based on the Front Controller pattern and used to create an MVC (Model View Controller) architecture.

What is a Front Controller Pattern?

A Front controller pattern follows the rule of having a single entity controlling the entire application. The single entity acts as a barrier between the client and the remote application. All requests targeted towards the application and first received by the single entity and then based on the controlling flow of the application, the requests are forwarded to the intended recipient module of the application.

The advantage of the Front Controller Pattern is in the simplicity of maintaining a single entity instead of multiple flows controlled by multiple entities. This results in streamlining the flow and proper filtering of the requests made to the application.

Why is Struts Framework essential in an MVC architecture? Read the rest of this entry »