protected void invoke(PortletRequest portletRequest, PortletResponse portletResponse, Integer methodID)
throws PortletException, IOException
{
MutablePortletApplication app = (MutablePortletApplication)portletDefinition.getPortletApplicationDefinition();
WebApplicationDefinition webApplicationDefinition = app.getWebApplicationDefinition();
if(webApplicationDefinition == null)
{
throw new IllegalStateException("Portlet application "+app.getName()+ " has no associated web application.");
}
String portletApplicationName = webApplicationDefinition.getContextRoot();
// gather all required data from request and response
ServletRequest servletRequest = ((javax.servlet.http.HttpServletRequestWrapper) portletRequest).getRequest();
ServletResponse servletResponse = ((javax.servlet.http.HttpServletResponseWrapper) portletResponse).getResponse();