// add the cocoon header timestamp
res.setProperty("X-Cocoon-Version", Constants.VERSION);
// get the request (wrapped if contains multipart-form data)
ActionRequest request;
try {
if (this.enableUploads) {
request = requestFactory.getServletRequest(req);
} else {
request = req;
}
} catch (Exception e) {
if (getLogger().isErrorEnabled()) {
getLogger().error("Problem with Cocoon portlet", e);
}
manageException(req, res, null, null,
"Problem in creating the Request", null, null, e);
return;
}
// Get the cocoon engine instance
getCocoon(request.getParameter(Constants.RELOAD_PARAM));
// Check if cocoon was initialized
if (this.cocoon == null) {
manageException(request, res, null, null,
"Initialization Problem",
null /* "Cocoon was not initialized" */,
null /* "Cocoon was not initialized, cannot process request" */,
this.exception);
return;
}
// We got it... Process the request
String servletPath = this.servletPath;
if (servletPath == null) {
servletPath = "portlets/" + getPortletConfig().getPortletName() + '/';
}
String uri = servletPath;
String pathInfo = request.getParameter(PortletEnvironment.PARAMETER_PATH_INFO);
if (pathInfo != null) {
if (pathInfo.length() > 0 && pathInfo.charAt(0) == '/') {
pathInfo = pathInfo.substring(1);
}
uri += pathInfo;