If perform and execute methods are the same, why they replaced execute in place of perform from 1.0 to 1.1?

Showing Answers 1 - 3 of 3 Answers

g4java

  • Aug 17th, 2007
 

The reason for doing this was because the perform() could only throw IOException and ServletException and it was realized that Action classes should be able to throw any Exception required by the programmer. Since it was desired that code still be backward compatible, a new method was added in place the perform() method. The new method is execute(). Here is the method signature:

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws java.lang.Exception

As you can see, the only difference is that execute() is declared to throw Exception rather than IOException and ServletException.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions