John,
long comment:
The portlet markup must be created in the render phase of a portlet's life cycle, which is represented by the render method of interface javax.portlet.Portlet. doView, doEdit etc. are methods of GenericPortlet, which is an adapter class of the Portlet interface. The render method dispatches to them.
It is not forbidden (and quite common for simple examples) to produce HTML markup during the render call, e.g. in the doView method.
JSP is one option to create the markup (you may choose other technologies like tapestry or
JSF) during the render call. In this case, your markup is in the JSP file, and the render (or doView) call includes its output with a PortletRequestDipatcher. The data presented by the JSP (
Java objects) is created before the include call in the render phase or during processAction (two options here).
short comment:
we do it just as you have described it
Greetings, Stefan