Welcome Message

Hi, welcome to my website. This is a place where you can get all the questions, puzzles, algorithms asked in interviews and their solutions. Feel free to contact me if you have any queries / suggestions and please leave your valuable comments.. Thanks for visiting -Pragya.

January 25, 2011

HTTP Status Codes

HTTP Status Codes represent the status of response received by Client from the Server

Overall range
Defined range
Category
100-199
100-101
Informational
200-299
200-206
Successful
300-399
300-305
Redirection
400-499
400-415
Client error
500-599
500-505
Server error

January 23, 2011

Struts - Controller


In a Struts application, two components make up the Controller. These two components are the
org.apache.struts.action.ActionServlet and the org.apache. struts.action.Action classes. In most Struts
applications, there is one org. apache.struts.action.ActionServlet implementation and many org.apache.
struts.action.Action implementations. ActionServlet acts as an Action factory by creating specific Action classes based on the user’s
request.


The org.apache.struts.action.ActionServlet is the Controller component that handles client requests and
determines which org.apache.struts.action.Action will process the received request. When assembling simple
applications, the default ActionServlet will satisfy your application needs,
and therefore, you do not need to create a specialized org.apache.struts.action.ActionServlet implementation.

Also, we generally use Action Mappings as *.do, but we do not append that in URL. This is because when we use , .do is automatically appended. 


January 22, 2011

WebApps


Web applications allow compiled classes to be stored in both the /WEB−INF/classes and /WEB−INF/lib
directories. Of these two directories, the class loader will load classes from the /classes directory first,followed by the JARs in the /lib directory. If you have duplicate classes in both the /classes and /lib
directories, the classes in the /classes directory will take precedence.

January 9, 2011

Manage ( Enable / Disable ) startup programs in Windows Vista

You can Enable / Disable startup programs on your PC with Windows Vista by following the following simple steps :

1. Go to Control Panel  -> Windows Defender



2. Then go to Tools and then Software Explorer (as shown in the image below)

3. Make sure that the Category selected is 'Startup Programs'.

Then select the program that you want to Disable or Remove and click the corresponding button(as shown below).





Servlet load-on-startup

The value of the tag load-on-startup helps the container determine when the servlet has to be loaded.

A value >=0 means that the servlet has to be loaded when the application is deployed.

If the value is less than zero or if the tag element is not present, the servlet will be loaded when it is first called.

Also, the order in which servlets are loaded is determined by the value of load-on-startup. The servlet which has a lower load-on-startup value will be loaded first. e.g the servlet with value 2 will be loaded before the servlet with this value as 4.

Apart from this, if two servlets have same value of load-on-startup, then they are loaded in the order in which they are defined in the Deployment descriptor file.

January 4, 2011

An Unusual Paragraph

This is a most unusual paragraph. How quickly can you find out
what is so unusual about it? It looks so ordinary, you'd think
nothing was wrong with it and in fact, nothing is wrong with it.
It is unusual, why? Study it. Think about it and you may find
out. If you work at it for a bit,
it will dawn on you. Try to do it without coaching.


January 3, 2011

World War - I Puzzle

A grandfather is telling his grandson stories of world war.

He said :

"At the end of World War 1, I was awarded for my bravery
after saving a group of my men"

"We were fighting in northern France and one of our
enemies threw a grenade at us. I managed to pick it up and
throw it away before it exploded. So right after the war
ended, a General gave me a sword, engraved with the words
'Awarded for Bravery and Valor, A True Hero, World War 1'".

"The grandson thinks about the story for a minute and then
says "Grandpa, that story can't be true!"

How did the grandson know?