There is an inconsistency in the Servlet API concerning the definition of the root context path.
The context path always comes first in a request URI. The path starts with a "/" character but does not end with a "/" character. For servlets in the default (root) context, this method returns "". [This is word-for-word the same definition as in HttpServletRequest]
The given path must be begin with "/", is interpreted relative to the server's document root and is matched against the context roots of other web applications hosted on this container.
Considering this, we cannot assume that only Tomcat has problems with getContext(""). One solution is to patch PortletContextManager#getPortletContext(ServletContext, String) to substitute "/" for "". Another is to have PortletWindowConfig#createPortletId do the swap.