Share

Difference between Servlet Vs Portlet



Portlet
Servlet
These are desinged to provide aggregate content on a page
Servlet is designed to generate whole web content
Apart from web.xml as a deployment descriptor portlet has one more deployment descriptor portlet.xml
Here only one web.xml as deployment descriptor
While developing portlet we can't predict portlet URL
We can predict servlet's URL at development time as part of element in web.xml
Portlet does not have direct access to ActionRequest,RenderRequest and ResourceRequest.Instead it have access to PortletRequest interface.
Servlet has direct access to ServletRequest and ServletResponse objects
Portlets provides various modes like view,help,edit etc.
Like portlet it does not have modes
While serving user request portlet will execute different methods depending on phase(render,action and resource)
While it serves by using service() method
Portlet specification provides different window states like minimized,maximized and Normal
Servlet specification does not have like portlet.
It always responds two type of action-render and request
It always responds single type of action-request

No comments:

Post a Comment