So you have to extend the MVCPortlet class. Both calls are used to include JSP after doView processing is doView . If you look at the source code of this class, then you will understand what a stream is, below is my explanation:
super.doView (renderRequest, renderResponse);
This includes the default JSP, i.e. view.jsp , which you could (or not) configure in portlet.xml like this:
<init-param> <name>view-template</name> <value>/html/view.jsp</value> </init-param>
This superclass method does nothing but call the include(viewJSP, renderRequest, renderResponse); method include(viewJSP, renderRequest, renderResponse); in the end.
include (viewJSP, renderRequest, renderResponse);
This method includes any JSP path that you specified for the viewJSP parameter. Thus, with this call you can specify, including different JSPs for different conditions, something like the following:
if (isThisTrue) { include("/html/myCustomPortlet/view.jsp", renderRequest, renderResponse); } else if (isThisTrueThen) { include("/html/myCustomPortlet/first/another_view.jsp", renderRequest, renderResponse); } else { super.doView(renderRequest, renderResponse); }
Thus, depending on your requirement, you can use either of the two or a combination of the two, as shown above. Hope this helps.