Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between handleRequestInternal and handleRequest

I have just started spring, I found that somewhere we are using handlerequest() method in controller and somewhere we are using handlerequestinternal() method.

I have tried google-ing this, but did not find any specific point.

Can any one explain what is the difference between these two functions and when we should implement each of them?

As I know spring framework will call by default handlerequest() function, so we can put our service layer there itself.

I am sure handlerequestinternal() must be providing some extra feature, but not sure.

Please help me to understand this.

like image 284
Pedantic Avatar asked Mar 23 '12 15:03

Pedantic


1 Answers

Both handleRequest and handleRequestInternal are used by the old Spring 2.0 controller framework.

handleRequestInternal is used when you're extending one of the pre-supplied base support classes (e.g. AbstractController, SimpleFormController, etc). These use the Template design pattern, and you supply your business logic in that method.

handleRequest is the method specified on the Controller interface itself. If you directly implement that interface, rather than extending one of the above base classes, then you need to implement handleRequest directly.

Both are obsolete, and not used in controllers written for Spring 2.5 and later.

like image 154
skaffman Avatar answered Sep 30 '22 03:09

skaffman