001
014
015 package com.liferay.portal.captcha;
016
017 import com.liferay.portal.kernel.captcha.CaptchaUtil;
018 import com.liferay.portal.kernel.log.Log;
019 import com.liferay.portal.kernel.log.LogFactoryUtil;
020 import com.liferay.portal.struts.ActionConstants;
021 import com.liferay.portal.struts.PortletAction;
022
023 import javax.portlet.ActionRequest;
024 import javax.portlet.ActionResponse;
025 import javax.portlet.PortletConfig;
026
027 import org.apache.struts.action.ActionForm;
028 import org.apache.struts.action.ActionMapping;
029
030
033 public class CaptchaPortletAction extends PortletAction {
034
035 @Override
036 public void processAction(
037 ActionMapping mapping, ActionForm form, PortletConfig portletConfig,
038 ActionRequest actionRequest, ActionResponse actionResponse)
039 throws Exception {
040
041 try {
042 CaptchaUtil.serveImage(actionRequest, actionResponse);
043
044 setForward(actionRequest, ActionConstants.COMMON_NULL);
045 }
046 catch (Exception e) {
047 _log.error(e);
048 }
049 }
050
051 @Override
052 protected boolean isCheckMethodOnProcessAction() {
053 return _CHECK_METHOD_ON_PROCESS_ACTION;
054 }
055
056 private static final boolean _CHECK_METHOD_ON_PROCESS_ACTION = false;
057
058 private static Log _log = LogFactoryUtil.getLog(CaptchaPortletAction.class);
059
060 }