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 |
What is filter? Can filter be used as request or response?
What is Single Threaded Model in Servlets? Explain this with an example?
Is it possible to send a mail from a servlet? Explain?
What are different Authentication options available in Servlets.
What are the kinds of http requests?
How will you open a new page after certain interval of time (5 sec), on clicking of a button in an html page?
What is SingleThreadModel interface?
Why filter is used in servlet?
What are the phases of servlet life cycle?
How do you invoke a Servlet? What is the difference between doPost method and doGet method?
What if you need to span your transaction across multiple servlet invocations?
Does servlet have main method?