Thursday, November 19, 2009

some important points on static and non static method overriding

a static method (in a subclass) may hide another static method (in a superclass)
a static method (in a subclass) cannot hide a non-static method (in a superclass)
a non-static method (in a subclass) may override another non-static method (in a superclass)
a non-static method (in a subclass) cannot override a static method (in a superclass)

Wednesday, November 11, 2009

different types of Synchronization


 
Types of Synchronization:
1)Method level Synchronization: A method can be Synchronized by adding a perfix word Synchronize . Here we have Parametrised Synchronization options also.
example: public Synchronize void foo(){}
2)Block level Synchronization: A block can be Synchronized by adding a perfix word Synchronize . Here we have Parametrised Synchronization options also.
Synchronize { }

Types of action clases in stuts


There are fine different types of actions in the struts

i) Forward Action (to forward a request to another resource in your 
application)

ii) Include Action ( To include some action )

You Might be wondering what the difference between Forward Action and Include 
Action so here it is : The difference is that you need to use the IncludeAction 
only if the action is going to be included by another action or JSP. Use 
ForwardAction to forward a request to another resource in your application such 
as a Servlet that already does business logic processing or even another JSP 
page.

iii) Dispatch Action ( to group related actions into one class)

iv) Lookup Dispatch Action (is useful if the method name in the Action is not 
driven by its name in the front end but by the Locale independent key into the 
resource bundle.)

The difference between LookupDispatchAction and DispatchAction is that the 
actual method that gets called in LookupDispatchAction is based on a lookup of a 
key value instead of specifying the method name directly.

v) Switch Action (The SwitchAction class provides a means to switch from a 
resource in one module to another resource in a different module. SwitchAction 
is useful only if you have multiple modules in your Struts application. The 
SwitchAction class can be used as is without extending.)