Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Rahul Saraswat
Error while checking Captcha
2. April 2013 01:59
Antwort

Rahul Saraswat

Rang: Junior Member

Nachrichten: 42

Eintrittsdatum: 26. Februar 2013

Neue Beiträge

HI,

I am trying to implement Captcha in my custom portlet. I am able to get the image but when I submit I get an error which says :


08:51:51,790 ERROR [http-bio-8080-exec-229][IncludeTag:253] Current URL /web/propcowebdemo/generic-portlet?captchaText=7095 generates exception: null
08:51:51,793 ERROR [http-bio-8080-exec-229][IncludeTag:154] java.lang.NullPointerException
at com.liferay.taglib.aui.InputTag.updateFormValidators(InputTag.java:270)
at com.liferay.taglib.aui.InputTag.doEndTag(InputTag.java:45)
at org.apache.jsp.html.taglib.ui.captcha.simplecaptcha_jsp._jspx_meth_aui_005finput_005f0(simplecaptcha_jsp.java:535)
at org.apache.jsp.html.taglib.ui.captcha.simplecaptcha_jsp._jspService(simplecaptcha_jsp.java:467)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:97)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PACLRequestDispatcherWrapper.java:90)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLRequestDispatcherWrapper.java:54)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:345)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:245)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:86)
at org.apache.jsp.html.taglib.ui.captcha.page_jsp._jspService(page_jsp.java:428)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:97)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PACLRequestDispatcherWrapper.java:90)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLRequestDispatcherWrapper.java:54)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:345)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:245)



Can anyone help? Thanks in advance.

Thanks & Regards
Abhimanyu Saraswat
Gouse Basha
RE: Error while checking Captcha
2. April 2013 02:07
Antwort

Gouse Basha

Rang: New Member

Nachrichten: 10

Eintrittsdatum: 30. November 2012

Neue Beiträge

You tried this captcha code

<portlet:resourceURL var="captchaURL" />
<liferay-ui:captcha url="<%= captchaURL %>"/>
Parikshit Sharma
RE: Error while checking Captcha
2. April 2013 05:39
Antwort

Parikshit Sharma

Rang: New Member

Nachrichten: 21

Eintrittsdatum: 16. Januar 2013

Neue Beiträge

Rahul Saraswat:
HI,

I am trying to implement Captcha in my custom portlet. I am able to get the image but when I submit I get an error which says :


08:51:51,790 ERROR [http-bio-8080-exec-229][IncludeTag:253] Current URL /web/propcowebdemo/generic-portlet?captchaText=7095 generates exception: null
08:51:51,793 ERROR [http-bio-8080-exec-229][IncludeTag:154] java.lang.NullPointerException
at com.liferay.taglib.aui.InputTag.updateFormValidators(InputTag.java:270)
at com.liferay.taglib.aui.InputTag.doEndTag(InputTag.java:45)
at org.apache.jsp.html.taglib.ui.captcha.simplecaptcha_jsp._jspx_meth_aui_005finput_005f0(simplecaptcha_jsp.java:535)
at org.apache.jsp.html.taglib.ui.captcha.simplecaptcha_jsp._jspService(simplecaptcha_jsp.java:467)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:97)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PACLRequestDispatcherWrapper.java:90)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLRequestDispatcherWrapper.java:54)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:345)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:245)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:86)
at org.apache.jsp.html.taglib.ui.captcha.page_jsp._jspService(page_jsp.java:428)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:97)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PACLRequestDispatcherWrapper.java:90)
at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLRequestDispatcherWrapper.java:54)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:345)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:245)



Can anyone help? Thanks in advance.

Thanks & Regards
Abhimanyu Saraswat


Seems that you are using the code in jsp without form, only the 2 lines given in above comment,use captcha in the form eg:-

 1
 2<portlet:actionURL var="createAccoutURL">
 3    <portlet:param name="saveLastPath" value="0" />
 4    <portlet:param name="struts_action" value="/login/create_account" />
 5</portlet:actionURL>
 6
 7<aui:form action="<%= createAccoutURL %>" method="post" name="fm">
 8
 9 <portlet:resourceURL var="captchaURL"/>
10
11<liferay-ui:captcha url="<%= captchaURL %>" />
12
13</aui:form>

It's just an example from create_account.jsp it will resolve you error.
Rahul Saraswat
RE: Error while checking Captcha
9. Oktober 2013 05:16
Antwort

Rahul Saraswat

Rang: Junior Member

Nachrichten: 42

Eintrittsdatum: 26. Februar 2013

Neue Beiträge

Hi everyone,

Captcha is working fine now. I used below code :

<div class="personaldetail-single-sec">
<%
if (enableCaptcha) {
%>
<liferay-ui:captcha url="<%= captchaURL %>"/>
<%
}
%>
</div>


I used below url for captcha :

<liferay-portlet:resourceURL var="captchaURL" id="showCaptcha">
<liferay-portlet:param name="time" value="<%=String.valueOf(System.nanoTime())%>"/>
</liferay-portlet:resourceURL>

I used time parameter to differentiate every request for captcha.

Thanks & Regards
Rahul Saraswat