What is the difference between callling a RequestDispatcher
using ServletRequest and ServletContext?

Answers were Sorted based on User's Feedback



What is the difference between callling a RequestDispatcher using ServletRequest and ServletContext..

Answer / mahesh

We can give relative URL when we use ServletRequest and not
while using ServletContext.

Is This Answer Correct ?    7 Yes 0 No

What is the difference between callling a RequestDispatcher using ServletRequest and ServletContext..

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

Post New Answer

More Servlets Interview Questions

What is http servlet?

0 Answers  


What are the methods in HttpServlet?

8 Answers  


Explain servlet events?

0 Answers  


What is called servlet container?

0 Answers  


How to work with Chinese login page (internationalization).if he enters user name and password in chinese, how is it converted to English and validate in db? And in reverse it should display welcome message in Chinese,if user is valid

4 Answers   Bosch,






When the methods init() and Distroy() will be called?

2 Answers  


What do you mean by url pattern in servlet?

0 Answers  


What is servlet collaboration?

0 Answers  


What is httpservlet and how it is different from genericservlet?

0 Answers  


How to create war file?

0 Answers  


how do you maintain sessions in servlets?

5 Answers   AZTEC, L Cube,


Is servlet a server side scripting language?

0 Answers  


Categories