Search This Blog

Sunday, September 20, 2009

History of web application Development:

Initial Development:

  • Before 90's no one used the Internet
  • only the American army is used the Internet for sharing information between two terriotory.
  • In 1995 commercialisation of the Internet began.
  • Initially the web pages are static only.
  • Static page are not specific to particular customer.
  • In later the Dynamic web pages are changed the way to modern web world.
  • Dynamic content are specifically targeted for a particular customer.
  • Initially all the dynamic web pages are developed using CGI(Common Cateway Interface) technology.

Intermediate Development:

  • In 1995 Java enabled Applet changed the face of web pages more elegant.
  • JVM enabled Browser can display the applet in browser.
  • Using applet we can get the user input and based on the user input display the data.
  • In 1997 sun micro system released Java servlet technology ,that enabled very quick response to client as well as new dimension to the web technology.
  • Servlet has more efficient execution model than CGI because they are multi thread instead of requesting new process for each request.
  • Later JSP was introduced by sun microsystem for easy of web development.

Saturday, September 5, 2009

NULL in Java:On the Job Problem

On the job problem: When I was integrating the development page one of my colleague I have come across hidden error in jsp.

We have to display hyphen if any string data type value is null or empty string.

So we used to write code like if( data_str==null || data_str.equals(“”))

He wrote like then if(data_str.equals(null) || data_str.equals(“”))
So we havn’t received any error but the execution is stopped when the control reach this statement.
If we run this application using java then we will get run time exception null pointer exception when we pass data_str as null
public class EqualTestProgram {

public static void main(String arg[])
String test=null;
System.out.println("before if");
if(test.equals(null)|| test.equals("") )
System.out.println("with in if");
System.out.println("after if");

i/p test=””;
before if
with in if
after if

i/p test=null;
Before if
Null pointer Exception

How to Include Inteface in JSP?

When i was started working as a TL.I have to give the technical assistance to my subordinate.
So one day he asked my how to include interface in JSP and access the interface static value.
I gave the answer as,

1. It’s possible to include Interface in jsp use bean class tag.
• No because java cants instances the object for the interface so jsp use bean will throws the error.
• Eg:
2. It’s possible to include with out constructer java Class file in jsp use bean class tag.
• No, because its can’t create object for the with out constructer class java.
• Its throw error.
3. How to access Interface static variable in Jsp file?
• Its possible, there is two possible for that
• Way1: we have to import the javaclass which has implemented the java interface
• Create the object for that interface implemented class, using the reference variable we can access the interface final variable.
• Acc_Cheque_Detail acd=new Acc_Cheque_Detail();acd.RECEIVED
• Way2: we have to create interface reference variable assign the implemented the class objects.
• Using that interface reference variable we can access the interface final variable.

HTML Multiple CheckBOX problem and solution

when we have more than one cheque(checkbox) in a list then only length of the cheque will be return otherwise that particular chceck box will be consider as single the length of the checkbox will be return as null.