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 |
Hi frnds iam new to Java Kindy any one can provide or me Servlets Example code and can explain to me flow of servlets and as Jsp and Struts and provide to me some sample example on these 3 topic flow,code example,and tutorials,and related websites which i can refer....thanks in advance..........
Can we use threads in Servlets?
What is the web server used for running the Servlets?
What is servlet interface?
What is meant by a servlet?
How can you run a servlet program?
What is Servlet API used for connecting database?
What is forward() and include() of servlets RequestDispatcher interface?
What is servlet lazy loading?
What is the difference between 2 types of servlets?
Can we use servlets in JavaScript?
what is SSL?