Hi..
I've just read a book that describes a little about RequestDispatcher. It is said that both ServletContext and ServletRequest has method getRequestDispatcher() that returns RequestDispatcher, but it doesn't explains any specific behaviour about this (Request Dispatcher scope or life cycle or something like that). Actually, what is the difference between them?
Another question. It is said that RequestDispatcher has method forward() and include(). What is the difference between them? Both has same functionality, isn't it? After all, one of them can be used to forwarding request to another servlet that designed for specific task after partially processed in current servlet (who calls forward or include). After all, why should we need forward() or include()? Why dont just servlet X calls the doXXX() method of servlet Y instead of call forward() or include()? After all, the doXXX() is always public...
Thanks in advance...
I've just read a book that describes a little about RequestDispatcher. It is said that both ServletContext and ServletRequest has method getRequestDispatcher() that returns RequestDispatcher, but it doesn't explains any specific behaviour about this (Request Dispatcher scope or life cycle or something like that). Actually, what is the difference between them?
Another question. It is said that RequestDispatcher has method forward() and include(). What is the difference between them? Both has same functionality, isn't it? After all, one of them can be used to forwarding request to another servlet that designed for specific task after partially processed in current servlet (who calls forward or include). After all, why should we need forward() or include()? Why dont just servlet X calls the doXXX() method of servlet Y instead of call forward() or include()? After all, the doXXX() is always public...
Thanks in advance...