Showing posts with label Request Dispatcher. Show all posts
Showing posts with label Request Dispatcher. Show all posts

Monday, 6 May 2013

Comparing Servlets and Portlets Part 2 : Using RequestDispatcher


In the last article we saw how we create a simple Servlet or a Portlet by implementing or extending appropriate interfaces and classes.

Lets continue to see what other differences are there.

RequestDispatcher

Unlike a Servlet where we can use either ServletRequest or ServletContext to get a RequestDispatcher object in a Portlet we can only use the PortletContext to do that. Just to refresh your memory RequestDispatcher can be used to forward the request to another Servlet or a JSP for further processing.