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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With