3) RequestDispatcher .forward
No response is send to the browser, the web container internally redirects the request to the other page. Remember , you can redirect only to a page within current servlet context.
Also there are two flavours of RequestDispatcher , one : you get from ServletContext .The pathname must begin with a "/" and is interpreted as relative to the current context root.
Second : you get from ServletRequest. The pathname specified may be relative, although it cannot extend outside the current servlet context. If the path begins with a "/" it is interpreted as relative to the current context root
Remember , you can redirect only to a page within current servlet context.
The pathname must begin with a "/" and is interpreted as relative to the current context root.The pathname specified may be relative, although it cannot extend outside the current servlet context.
The pathname specified may be relative, although it cannot extend outside the current servlet context.
The { and } indicate that it is an initializer. All non-staic initializers are executed each time just before the constructor.