if (portletSession == null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Creating new portlet session...");
}
final OptionalContainerServices optionalContainerServices = container.getOptionalContainerServices();
final PortletEnvironmentService portletEnvironmentService = optionalContainerServices.getPortletEnvironmentService();
portletSession = portletEnvironmentService.createPortletSession(container,
getHttpServletRequest(),
portletContext,
httpSession,
internalPortletWindow);
}