GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE  >  Struts
Go To First  |  Previous Question  |  Next Question 
 Struts  |  Question 95 of 103    Print  
why was perform() method changed as execute() method in Action class?
Help me


  
Total Answers and Comments: 3 Last Update: February 19, 2009     Asked by: Anupama 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Nikita Dodiya
 
The new method execte() is necessary because the perform() method declares that it throws only IOException and ServletException. Due to the added declarative exception-hndling functionality, the framework needs to catch all instance of java.lang.Exception from Action class.

Instead of changing the method signature for the perform() method and breaking backward compability, the execute method was added.

Above answer was rated as good by the following members:
getravi2k, yathirajulu
November 20, 2007 05:08:49   #1  
Nikita Dodiya        

RE: why was perform() method changed as execute() meth...
The new method execte() is necessary because the perform() method declares that it throws only IOException and ServletException. Due to the added declarative exception-hndling functionality the framework needs to catch all instance of java.lang.Exception from Action class.

Instead of changing the method signature for the perform() method and breaking backward compability the execute method was added.

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
May 23, 2008 00:10:41   #2  
rakesh_mehta Member Since: May 2008   Contribution: 2    

RE: why was perform() method changed as execute() method in Action class?
hi.. In struts 1.1 perform() method is used in action class..
but In struts 1.2 execute() method is arrive.. so that execute method is used in actio class.. But There is no difference between perform() and execute() method.. both works like same.. Execute the data from the ActionFormBean...

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
February 19, 2009 04:19:23   #3  
arkhan_mum Member Since: February 2009   Contribution: 1    

RE: why was perform() method changed as execute() method in Action class?

The only difference between the two is
execute() throws Expection whereas
perform() throws IOException and ServletException
perform() has now been depricated so one should use execute() only.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape