1
14
15 package com.liferay.portal.captcha;
16
17 import com.liferay.portal.kernel.captcha.CaptchaUtil;
18 import com.liferay.portal.kernel.log.Log;
19 import com.liferay.portal.kernel.log.LogFactoryUtil;
20 import com.liferay.portal.struts.ActionConstants;
21 import com.liferay.portal.struts.PortletAction;
22
23 import javax.portlet.ActionRequest;
24 import javax.portlet.ActionResponse;
25 import javax.portlet.PortletConfig;
26
27 import org.apache.struts.action.ActionForm;
28 import org.apache.struts.action.ActionMapping;
29
30
35 public class CaptchaPortletAction extends PortletAction {
36
37 public void processAction(
38 ActionMapping mapping, ActionForm form, PortletConfig portletConfig,
39 ActionRequest actionRequest, ActionResponse actionResponse)
40 throws Exception {
41
42 try {
43 CaptchaUtil.serveImage(actionRequest, actionResponse);
44
45 setForward(actionRequest, ActionConstants.COMMON_NULL);
46 }
47 catch (Exception e) {
48 _log.error(e);
49 }
50 }
51
52 protected boolean isCheckMethodOnProcessAction() {
53 return _CHECK_METHOD_ON_PROCESS_ACTION;
54 }
55
56 private static final boolean _CHECK_METHOD_ON_PROCESS_ACTION = false;
57
58 private static Log _log = LogFactoryUtil.getLog(CaptchaPortletAction.class);
59
60 }