public void process(ActionRequest req, ActionResponse res, String path)
throws IOException, ServletException {
ActionRequestImpl reqImpl = (ActionRequestImpl)req;
ActionResponseImpl resImpl = (ActionResponseImpl)res;
HttpServletRequest httpReq = reqImpl.getHttpServletRequest();
HttpServletResponse httpRes = resImpl.getHttpServletResponse();
ActionMapping mapping = processMapping(httpReq, httpRes, path);
if (mapping == null) {
return;
}
if (!processRoles(httpReq, httpRes, mapping)) {
return;
}
ActionForm form = processActionForm(httpReq, httpRes, mapping);
processPopulate(httpReq, httpRes, form, mapping);
if (!processValidateAction(httpReq, httpRes, form, mapping)) {
return;
}
PortletAction action =
(PortletAction)processActionCreate(httpReq, httpRes, mapping);
if (action == null) {
return;
}
PortletConfigImpl portletConfig =
(PortletConfigImpl)req.getAttribute(WebKeys.JAVAX_PORTLET_CONFIG);
try {
action.processAction(mapping, form, portletConfig, req, res);
}
catch (Exception e) {
String exceptionId =
WebKeys.PORTLET_STRUTS_EXCEPTION + StringPool.PERIOD +
portletConfig.getPortletId();
req.setAttribute(exceptionId, e);
}
String forward =
(String)req.getAttribute(WebKeys.PORTLET_STRUTS_FORWARD);
if (forward != null) {
String queryString = StringPool.BLANK;
int pos = forward.indexOf("?");
if (pos != -1) {
queryString = forward.substring(pos + 1, forward.length());
forward = forward.substring(0, pos);
}
ActionForward actionForward = mapping.findForward(forward);
if ((actionForward != null) && (actionForward.getRedirect())) {
if (forward.startsWith("/")) {
PortletURLImpl forwardURL =
(PortletURLImpl)resImpl.createRenderURL();
forwardURL.setParameter("struts_action", forward);
StrutsURLEncoder.setParameters(forwardURL, queryString);