In the last article we saw how a RequestDispatcher works for both Servlets and Portlets.
Difference between a web and a portlet application.
A basic web application will have a web.xml file, Servlet classes and JSP's. The web.xml file helps to configure the Servlets which make the application. It helps a developer to define which URL's will be handled by which Servlets. How security will be applied to these URL's, session management etc.
A Portlet application will have a portlet.xml file in addition to web.xml file. Portlet XML file helps a developer to define the Portlets which make that application.
Now lets compare a web.xml and a portlet.xml file.
A web.xml file:
------------------
------------------
Now a portlet.xml file:
A web.xml has
Action URL and Render URL for example can be used to create URL's. ActionURL will help generate an Action Request, similar to what doPost does in Servlets. RenderURL is for a render request like the doGet in Servlets.
Example: PortletURL refreshURL = response.createRenderURL(); // response being a RenderResponse object
In addition to this basic configuration a portlet.xml can be used to define the init-params and resource bundle also.
No comments:
Post a Comment