Using CAPTCHA with jsf

Has anyone used CAPTCHA with jsf? Is there a free jar file for doing this?

I am using JSF 1.2 with RichFaces.
I want to implement SimpleCaptcha in the application.
On my loginpage I am able to add a captcha image.
Here is the exception that I get. This I get after when my jsp page(on which this image is) loads.
StandardWrapperValve[StickyCaptcha]: PWC1406: Servlet.service() for servlet StickyCaptcha threw exception
java.lang.IllegalStateException: PWC3999: Cannot create a session after the response has been committed
at org.apache.coyote.tomcat5.CoyoteRequest.doGetSession(CoyoteRequest.java:2709)
at org.apache.coyote.tomcat5.CoyoteRequest.getSession(CoyoteRequest.java:2482)
at org.apache.coyote.tomcat5.CoyoteRequestFacade.getSession(CoyoteRequestFacade.java:871)
at org.apache.coyote.tomcat5.CoyoteRequestFacade.getSession(CoyoteRequestFacade.java:882)
at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:248)
at nl.captcha.servlet.SimpleCaptchaServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
What could be the reason?

Similar Messages

  • Any sample for using Captcha with Oracle ADF ?

    Hi
    Thank you for reading my post
    is there any sample available for using captcha with adf faces ?
    thanks

    Hi,
    nott hat I am aware of. However, I started a project to build a custom JSF component using
    http://jcaptcha.sourceforge.net/
    Not sure when I have this finished, but the goal is to have this working with ADF Faces (not sure if it makes sense to bind the component to ADF though)
    Frank

  • Navigation problem when using tiles with JSF

    Hi all,
    I m using tiles with JSF. i have included all the libraries and jsp page is rendered properly. but when i use <h:commandLink> in the body part of the JSP , i cannot go to the specified link. when we use tiles, what changes need to be done in faces-config file?? i mean what navigation rule we need to specify ??

    Hello, I have the same problem; JSF+Tiles = No navigation.
    One basic question is should I reference the parent jsp or the included body jsp in the faces-config.xml file.
    For example: The login.jsp is a main tiles page that includes a menu.jsp, header.jsp & a loginBody.jsp.
    Hence the faces-config could have this rule;
    <navigation-rule>
    <from-view-id>/login.jsp</from-view-id>
    <navigation-case>
    <to-view-id>/catalog.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    (I've left the outcome tag out to simplify this post)
    Or, I could refer loginBody.jsp in the navigation rule;
    <navigation-rule>
    <from-view-id>/loginBody.jsp</from-view-id>
    <navigation-case>
    <to-view-id>/catalog.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    The loginBody.jsp has a commandbutton which a user clicks which starts the navigation.
    Neither seems to work unfortunately & I'm a stuck.
    Thanks

  • Using Tiles with JSF

    Hi All,
    I am trying to integrate Tiles with JSF using the MyFaces components. I followed the following steps to use the MyFaces components in my web application:
    - Copied the jar files myfaces-jsf-api.jar, myfaces.jar, jstl.jar, jakarta-oro.jar, commons-codec-1.2.jar, commons-el.jar, commons-fileupload-1.0.jar, commons-logging.jar and commons-validator.jar to the WEB-INF/lib dir.
    - Removed the jsf-api.jar
    When I restart the my server I get the following error:
    com.sun.faces.config.ConfigureListener Can't parse configuration file:wsjar:file://WebContent/WEB-INF/lib/myfaces.jar!/META-INF/faces-config.xml
    com.sun.faces.config.ConfigureListener TRAS0014I: The following exception was logged java.net.SocketException: Operation timed out: connect:could be due to invalid address
    Kindly help me out. I am using WSAD 5.1.2 for development.
    Thanks in advance.
    Regards,
    Saket

    Saket,
    you have to remove all files from sun, if you want to use MyFAces instead of RI.
    com.sun.faces.config.ConfigureListener is a ContextListener, that is defined in TLD files of the RI. And also remove jsf-impl.jar
    here is a running MyFaces/Tiles example!
    http://cvs.apache.org/dist/incubator/myfaces/builds/
    HTH,
    -Matthias

  • Exception while using struts with jsf

    Hi
    Iam trying to integrate struts with jsf. when iam trying to load jsf page ...getting the following error
    Unable to initialize jsf interceptors probably due missing JSF implementation libraries
    Please help me to fix this .

    this is my web.xml
    <?xml version="1.0"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>appstruts2</display-name>
    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    </web-app>

  • Best Practices of using AJAX with JSF : BluePrints or  Ajax4Jsf ?

    am a newbie to AJAX4JSF . I think it provides Rapid Application Development (RAD) just by using tags like a4j: without the need to develop complex JSF Custom Components as shown in BluePrints Catalog
    https://bpcatalog.dev.java.net/ajax/jsf-ajax/
    I understand the purpose of developing JSF Custom components as Reusable for using with AJAX. But its complex and requires lot of coding i.e. PhaseListeners and Managed Beans. There should be easy way to do this especially our project needs RAD tool like AJAX4JSF.
    Any suggestions will be highly appreciated
    Regards
    Bansi

    Bansi, you are trying to compare orange-to-apple. Blue print catalog is a historical retrospection about what people thought about AJAXifying JSF in the past. Currently, the playground has been moved to the jsf-extension project. Look for DynaFaces there.

  • How-to use captcha with ADF Faces 10g (10.1.3)

    Hi All,
    Could You Pls tell me how to use the captcha using 10g currently i am using the jdeveloper version of 10.1.3. I have found the link for using the *[captcha using 11g|http://www.oracle.com/technology/products/jdev/tips/fnimphius/captcha/captcha.html]* but some of the components here such as af:panelFormLayout and af:panelGroupLayout are not available in 10g.Are there are any alternative components Availablel for the 10g
    regards
    Yeshwant

    Hi John ,
    Thankx for the reply ..
    i am getting the following compilation error *(Error: Attribute: halign is not a valid attribute name)* while doing that .
    i have written the code as follows...
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:panelForm id="pfl1">
    <f:facet name="footer"/>
    <af:objectImage source="/captchaservlet" id="i1"
    inlineStyle="width:251px; height:76.0px;"/>
    <af:commandButton text="can't read image" id="cb2"
    partialSubmit="false"/>
    <af:panelLabelAndMessage label="Are U a robot?" id="plam1">
    <af:panelGroup id="pgl1" layout="horizontal" halign="left">
    <af:inputText id="it1" value="#{requestScope.bestGuess}"/>
    <af:commandButton text="try" id="cb1"
    actionListener="#{HandleCaptchaBean.verifyAnswer}"
    partialSubmit="true" immediate="false"/>
    </af:panelGroup>
    <af:message id="m1" messageType="info" for="it1"/>
    </af:panelLabelAndMessage>
    </af:panelForm>
    </af:form>
    </af:document>
    </f:view>
    Thankx
    Regards
    Yeshwant

  • Using JFreeChart with JSF

    Hello Suners,
    I'm developing a JSF web application that uses JFreeChart. I'm having a problem when i run the project i get this error :
    java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.AbstractMethodError: gnu.xml.dom.DomElement.getTextContent()Ljava/lang/String;
            at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:932)
            at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:912)
            at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:694)
            at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1947)
            at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1619)
            at com.sun.enterprise.web.WebApplication.start(WebApplication.java:90)
            at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126)
            at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:241)
            at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:236)
            at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:339)
            at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
            at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
            at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
            at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
            at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
            at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
            at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
            at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
            at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
            at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
            at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
            at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
            at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
            at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
            at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
            at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
            at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
            at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
            at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
            at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
            at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
            at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
            at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
            at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
            at java.lang.Thread.run(Thread.java:619)I've done alot of researches on the internet and i figured out that JFreeChart is using gnujaxp implementation and JSF is using the standard Java XML parsing. Does anyone know how to set gnujaxp implementation in the system? and if there is a better solution it will be great to share it.
    King Regards,

    Saket,
    you have to remove all files from sun, if you want to use MyFAces instead of RI.
    com.sun.faces.config.ConfigureListener is a ContextListener, that is defined in TLD files of the RI. And also remove jsf-impl.jar
    here is a running MyFaces/Tiles example!
    http://cvs.apache.org/dist/incubator/myfaces/builds/
    HTH,
    -Matthias

  • Can I use Ajax with jsf

    Hi All,
    Is JSF 1.1 supports AJAX or not???
    Please tell me..

    JSF RI 1.1 = Java Server Faces Reference Implementation 1.1.
    It is the Sun reference implementation of JSF. There are also 3rd party implementations of JSF available, like MyFaces, Tomahawk, IceFaces, ADF, etcetera.
    If you aren't limited to JSF RI version 1.1, I recommend you to use version 1.2. It provides more features and benefits.
    Here are some links:
    https://javaserverfaces.dev.java.net
    http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/
    http://jsftutorials.net
    http://java.sun.com/javaee/5/docs/tutorial/doc/ (starting at chapter 9)
    http://jboss.org/projects/jbossAjax4jsf (most widely used AJAX library for JSF)

  • Using captcha with comments component

    I would like to require captcha whenever a comments component is added to a page. Any recommendations on the best approach?

    Hello Doug,
    For above requirement i would suggest you to override comments "/libs/collab/commons/components/comments" component locally to your project and then directly include captcha component at template level by modifying "/libs/collab/commons/components/comments/form.html.jsp" and inserting below include under the <form> tag at proper location.
    For example:
    <sling:include resourceType="foundation/components/form/captcha" replaceSelectors="captcha"/>
    Dont forget to add  replaceSelectors="captcha" because it will allow you to override all other selectors.
    Now inserting above include will include captcha inside comments <form> tag but you have to put validation code in same scriptlet "/libs/collab/commons/components/comments/form.html.jsp" on form submit to validate the captcha value.
    Also you can modify /libs/collab/commons/components/comments  component dialog by adding an extra property whether to add captcha as part of comment component or not which will give more flexibility to your comment component. You need not to worry about comments comment (when user comment on already provided comment) because "/libs/collab/commons/components/comments/comment" component form.html.jsp indirectly uses /libs/collab/commons/components/comments/form.html.jsp
    I hope it helps you to proceed. Let me know for more information.
    Thanks,
    Pawan

  • Using Toplink with JSF

    This kind of crosses the boundaries of 2 forms. And since I'm not getting much response over in JDev perhaps this forums residents could help shed some light on the problem:
    Updating Toplink objects with JSF

    Thanks for bringing the thread to my attention. Keeping an eye on all the forums is challenging and occasionally we miss TopLink specific questions in the other forums. I have posted a response looking for more information on the original thread.
    Doug

  • Jdeveloper 11.1.1.5.0 with jsf 2

    jdeveloper 11.1.1.5.0 support jsf 1.2
    i need to use jsf 2 to try the following tutorial http://weblogs.java.net/blog/driscoll/archive/2008/11/a_simple_ajax_j.html
    I have many problem when I tried it using jdeveloper with jsf 1.2
    so can I use jsf 2 with this version of jdeveloper of is there any tutorial to use jsf and ajax using my version of jdeveloper

    Belal,
    If you want to use JSF 2 with JDeveloper, you will need JDeveloper 11.1.2.
    If you want to deploy a JSF 2 application, you would need to use WebLogic Server 10.3.5 + the appropriate patches.
    There is no version of the full middleware stack (i.e. SOA, Forms, Reports, etc) that supports JSF 2 yet.
    John

  • Oscache with JSF?

    Hi guys,
    Anyone use oscache with JSF before? Let say I got a 'datatable' which get a list from a bean with applicationScope, should I use oscache to cache it?
    regards,
    kmthien

    your application scoped bean is alreay your cache.
    unless you have special caching needs that you feel oscache can solve and it will save you some code than you can probably use oscache instead of you application scope bean.
    personally, i have chosen application scoped beans to serve as my cache for application wide data that is read mostly or read only. using an extra caching mechanism would just make my application harder.

  • Where do I put the Jakarta files standard.jar and jstl.jar when developing with JSF 2.0 in OEPE using web logic server

    hi everybody, I am wondering what should i do with the standard.jar and jstl.jar files when using we logic. I tried putting both files into
    the directory c:\oracle\middleware\oracle_home\user_projects\domains\base_domain\bin.  I don't know if this is correct.  Thanks in
    in advance for the help.

    Anyways I found this link on www.oracle.com website by the same author of the book I am reading Deepak Vohra - Templating with JSF 2.0 Facelets.
    although here he is using Weblogic 11g although I don't think it makes a difference.  have a look at the Setting up the Environment section
    where he says to download the jstl.jar and standard.jar files.
    http://www.oracle.com/technetwork/articles/java/facelets-454361.html

  • Display Tag use with JSF Data Tables

    Has Anyone got to work the Display tag with JSF
    I have got soo far to display the table by using Display tag with JSF dataTables but unable to have a link or command button to navigate
    Theirs a online hack available for the same .....But i am unable to get to run it
    Has anybody got the solution for the same

    Hi ,
    I am trying to do the same but I have no success.
    My code is
    <html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:jsp="http://java.sun.com/JSP/Page"
         xmlns:c="urn:jsptld:http://java.sun.com/jstl/core"
         xmlns:display="urn:jsptld:http://displaytag.sf.net">
    <jsp:directive.page contentType="text/html; charset=UTF-8" />
    <jsp:directive.page import="fi.tavutaito.hibernate.User,java.util.*,org.displaytag.tags.TableTag" />
         <h:dataTable value="#{sessionScope.users}" var="user" style=""/>
         <display:table name="sessionScope.users" class="" id="user">
              <display:column property="username"/>
              </display:table>
    </html>
    where users is a List Obj in the session. In output I receive just this page.
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="urn:jsptld:http://java.sun.com/jstl/core" xmlns:display="urn:jsptld:http://displaytag.sf.net">
    <jsp:directive.page contentType="text/html; charset=UTF-8"></jsp:directive.page>
    <jsp:directive.page import="fi.tavutaito.hibernate.User,java.util.*,org.displaytag.tags.TableTag"></jsp:directive.page><table style="">
    <tbody>
    <tr>
    </tr>
    <tr>
    </tr>
    </tbody>
    </table>
         <display:table name="sessionScope.users" id="user">
              <display:column property="username"></display:column>
              </display:table>
    </html>
    It seems to that display tags are not parsed...
    Do zou have an idea?
    Thanks a lot in advance
    beppoz

Maybe you are looking for