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 |
Can we use javascript in Servlets?
Why do we have servlet filters?
Why don't we write a constructor in a servlet?
Explain servlet.
Difference between java beans & servlets?
What is cgi and what are its drawbacks?
Tell us something about servletcontext interface.
What are the differences between forward() method and sendredirect() methods?
What is the difference between portlet and servlet?
Why is init() method is used in servlets?
How can we include static files in the jsp page?
Hi guys.. Well can u tell me that why there is need of "init()" , i mean why can not we initialize the servlet object with the help of constructors? Thank you.