Multiple choice technology web technology

different between getRequestDispatcher() javax.servlet.servletRequest and javax.servlet.servletContext

  1. javax.servlet.servletRequest accepts relative path and javax.servlet.servletContext doesn't accepts relative path

  2. both are same

  3. javax.servlet.servletRequest for include and javax.servlet.servletContext for forward

  4. all of above

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

ServletRequest.getRequestDispatcher() accepts relative paths and can accept query strings, while ServletContext.getRequestDispatcher() requires absolute paths within the servlet context. Both support forward and include operations.