Multiple choice technology web technology

What is the difference between doing an include or a forward with a RequestDispatcher?

  1. The forward method transfers control to the designated resource, while the include method invokes the designated resource, substitutes its output dynamically in the display, and returns control to the calling page.

  2. The two methods provide the same functionality, but with different levels of persistence.

  3. The forward method is deprecated as of JSP 1.1 and the include method should be used in order to substitute portions of a dynamic display at runtime.

  4. The include method transfers control to a dynamic resource, while the forward method allows for dynamic substitution of another JPS pages output, returning control to the calling resource.

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The forward method permanently transfers control to the target resource - the client sees the target's response. The include method temporarily invokes the target, captures its output, inserts it into the current response, then returns control to the calling page. Option B incorrectly claims they differ only in persistence, C incorrectly states forward is deprecated, and D swaps their definitions.