What is the difference between callling a RequestDispatcher
using ServletRequest and ServletContext?
Answers were Sorted based on User's Feedback
Answer / mahesh
We can give relative URL when we use ServletRequest and not
while using ServletContext.
Is This Answer Correct ? | 7 Yes | 0 No |
Answer / prachetash
RequestDispatcher rd = request.getRequestDispatcher("result.jsp")
This is relative path, becoz there is no "/" slash.Container looks in same logical path.
RequestDispatcher rd = getServletContext.getRequestDispatcher("/result.jsp")
Is This Answer Correct ? | 0 Yes | 0 No |
How httpservlet is different from the genericservlet?
Can we fetch the attributes related to a servlet on a different servlet?
Can we get PrintWriter and ServletOutputStream both in a servlet?
How does java thread pool work?
Is servlet a server side scripting language?
how can you give alias to servlets?
Which exception is thrown if the servlet is not initialized properly?
How can I share objects across different sessions?
Why is init() method is used in servlets?
List some life cycle methods of a servlet.
when the jsp page is translated to servlet?
What is cgi?