This content has been marked as final.
Show 2 replies
-
1. Re: portlet title showing as null when not implementing doVi
sjlib Sep 8, 2005 4:15 PM (in response to scientist)Thats interesting. I noticed my Tapestry 4.0 portlets doing the same thing. It doesn't seem to me that there should be a reliance on implementing doView() to display the title. I mean it doesn't seem like reasonable behavior.
-
2. Re: portlet title showing as null when not implementing doVi
mholzner Sep 9, 2005 9:22 AM (in response to scientist)the portlet spec encourages you to extend GenericPortlet and overwrite the doXYZ methods. This is for a simple reason: the render method does things for you, one of those things being setting the title. If you decide to overwrite this, you'll need to take care of the title yourself!
from javax.portlet.GenericPortlet:public void render(RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException { response.setTitle(getTitle(request)); doDispatch(request, response); } protected void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException { if (!WindowState.MINIMIZED.equals(request.getWindowState())) { PortletMode portletMode = request.getPortletMode(); if (PortletMode.VIEW.equals(portletMode)) { doView(request, response); } else if (PortletMode.HELP.equals(portletMode)) { doHelp(request, response); } else if (PortletMode.EDIT.equals(portletMode)) { doEdit(request, response); } } }