Thursday, April 17, 2008

Getting a RequestDispatcher from a ServletRequest VS ServletContext

 

1)       request.getRequestDispatcher("/TestCalendar.jsp");

This will take the relative URL referred to Current Request.

 

 

2)       getServletContext().getRequestDispatcher("/jsp/TestCalendar.jsp");

This will take URL from context root. So if you are referring path in this method, always start with a Slash.

 

No comments:

Post a Comment