14 Replies Latest reply on Mar 17, 2011 1:44 PM by Julien Martin

    Basic problem with a4j:commandButton and jsf 2.0

    Julien Martin Expert

      Hello,

      I am having a great deal of trouble with a plain a4j:commandButton and Jsf 2.0/RF4RC1.

      My application has a form that I am trying to submit. The action method is not even called...

       

      Here is the bean:

      package com.jeanbaptistemartin.view;

       

       

      import com.jeanbaptistemartin.service.JbmService;

      import com.jeanbaptistemartin.domain.Personne;

      import com.jeanbaptistemartin.service.Message;

      import com.jeanbaptistemartin.util.FacesUtils;

      import com.ocpsoft.pretty.faces.annotation.URLAction;

      import com.ocpsoft.pretty.faces.annotation.URLMapping;

      import java.util.Date;

      import java.util.ResourceBundle;

      import javax.faces.application.FacesMessage;

      import javax.faces.component.UIInput;

      import javax.faces.context.FacesContext;

      import javax.faces.event.ActionEvent;

      import javax.faces.event.AjaxBehaviorEvent;

      import javax.faces.validator.ValidatorException;

      import org.apache.log4j.Logger;

      import org.springframework.beans.factory.annotation.Autowired;

      import org.springframework.context.annotation.Scope;

      import org.springframework.stereotype.Component;

       

       

      /**

      *

      * @author julien

      */

      @Component("contactView")

      @Scope("request")

      @URLMapping(id = "contactAction", parentId = "rootAction", pattern = "contact", viewId = "/contact.jsf")

      public class ContactView {

       

       

          private static transient Logger log = Logger.getLogger("com.jeanbaptistemartin.view");

          public static final String CAPTCHA_ID = "jbm";

          private JbmService service;

          @Autowired

          private Message message;

          private String secureText;

          @Autowired

          private ContactViewBackingBean bb;

          private String[] telephones;

          private Personne sculpteur;

       

       

          public ContactView() {

              log.debug("ContactView()");

          }

       

       

          @Autowired

          public ContactView(JbmService service) {

              log.debug("ContactView(JbmService service)");

              this.service = service;

              this.telephones = service.recupererTelephonesSculpteur();

              this.sculpteur = service.recupererSculpteur();

          }

       

       

          public Personne getSculpteur() {

              return sculpteur;

          }

       

       

          public void setSculpteur(Personne sculpteur) {

              this.sculpteur = sculpteur;

          }

       

       

          public String[] getTelephones() {

              return telephones;

          }

       

       

          public void setTelephones(String[] telephones) {

              this.telephones = telephones;

          }

       

       

          @URLAction

          public String contact() {

              log.debug("contact");

              return "/contact.xhtml";

          }

       

       

          public String envoyer() {

              log.debug("envoyer");

              service.envoyerMessage(this.message);

      //        FacesUtils fu = new FacesUtils();

      //        FacesContext fc = FacesContext.getCurrentInstance();

      //        ResourceBundle rb = ResourceBundle.getBundle("resources", fc.getViewRoot().getLocale());

      //        FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_INFO, rb.getString("message.envoi.reussi"), rb.getString("message.envoi.reussi"));

      //        fc.addMessage(fu.getClientId("envoyerMessage"), fm);

              this.bb.setLocalValuesSet(false);

              this.bb.setSubmittedValues(null);

              this.bb.setValues("");

              return null;

          }

       

       

          public Message getMessage() {

              log.debug("getMessage");

              return message;

          }

       

       

          public void setMessage(Message message) {

              log.debug("setMessage");

              this.message = message;

          }

       

       

          public void valider(ActionEvent evt) {//todo was javax.faces.event.ActionEvent

              log.debug("valider");

              UIInput comp = (UIInput) evt.getComponent().getParent();

              FacesContext fc = FacesContext.getCurrentInstance();

              ResourceBundle rb = ResourceBundle.getBundle("resources", fc.getViewRoot().getLocale());

              try {

                  comp.validate(fc);

                  FacesMessage fm = new FacesMessage();

                  fm.setSeverity(FacesMessage.SEVERITY_INFO);

                  fc.addMessage(comp.getClientId(fc), fm);

              } catch (ValidatorException ve) {

                  FacesMessage fm = new FacesMessage();

                  fm.setSeverity(FacesMessage.SEVERITY_ERROR);

                  fm.setSummary(rb.getString("message.erreur.validation"));

                  fm.setDetail(rb.getString("message.erreur.validation"));

                  fc.addMessage(comp.getClientId(fc), fm);

                  throw new ValidatorException(fm);

              }

          }

       

       

          public String getSecureText() {

              log.debug("getSecureText");

              return secureText;

          }

       

       

          public void setSecureText(String secureText) {

              log.debug("setSecureText");

              this.secureText = secureText;

          }

       

       

          public ContactViewBackingBean getBb() {

              log.debug("getBb");

              return bb;

          }

       

       

          public void setBb(ContactViewBackingBean bb) {

              log.debug("setBb");

              this.bb = bb;

          }

       

       

          public Date getNow() {

              log.debug("getNow");

              return new Date();

          }

      }

       

      Here is my jsf form:

       

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"

                      xmlns:ui="http://java.sun.com/jsf/facelets"

                      xmlns:h="http://java.sun.com/jsf/html"

                      xmlns:f="http://java.sun.com/jsf/core"

                      xmlns:a4j="http://richfaces.org/a4j"

                      xmlns:rich="http://richfaces.org/rich">

          <a4j:region>

              <h:panelGrid id="formulaireContactP" columns="3" columnClasses="libellesColonne,champsColonne,validiteColonne">

                  <h:outputText value="#{msg['message.from.email']}" />

                  <a4j:outputPanel id="fromEmail">

                      <h:inputText id="email"

                                   value="#{contactView.message.email}"

                                   required="true"

                                   requiredMessage="#{msg['message.valeurRequise.email']}"

                                   validatorMessage="#{msg['message.erreur.email']}"

                                   binding="#{contactView.bb.emailI}"

                                   maxlength="50"

                                   size="20"

                                   styleClass="emailI">

                          <f:validator validatorId="adresseEmailValidator" />

                          <f:ajax event="click" listener="#{contactView.valider}"/>

                      </h:inputText>

                  </a4j:outputPanel>

                  <a4j:outputPanel id="emailMP" ajaxRendered="true">

                      <h:message for="email"  infoClass="champValide" styleClass="champInvalide"/>

                  </a4j:outputPanel>

       

       

                  <h:outputText value="#{msg['message.from.nom']}" />

                  <a4j:outputPanel id="nom">

                      <h:inputText id="nomI"

                                   value="#{contactView.message.nom}"

                                   required="true"

                                   requiredMessage="#{msg['message.valeurRequise.nom']}"

                                   binding="#{contactView.bb.nomI}"

                                   maxlength="50"

                                   size="20"

                                   styleClass="nomI">

                           <f:ajax listener="#{contactView.valider}" render="nom nomMP"/>

                          <f:validateLength minimum="3" />

                      </h:inputText>

                  </a4j:outputPanel>

                  <a4j:outputPanel id="nomMP" ajaxRendered="false">

                      <h:message for="nomI" infoClass="champValide" styleClass="champInvalide"/>

                  </a4j:outputPanel>

       

       

                  <h:outputText value="#{msg['message.sujet']}" rendered="false"/>

                  <a4j:outputPanel id="sujet" rendered="false">

                      <h:inputText id="sujetI" value="#{contactView.message.sujetMessage}" required="true"

                                   requiredMessage="#{msg['message.valeurRequise.sujet']}" validatorMessage="#{msg['message.erreur.sujet']}" binding="#{contactView.bb.sujetI}" maxlength="50" size="20">

                          <f:validateLength minimum="2" />

                      </h:inputText>

                  </a4j:outputPanel>

                  <a4j:outputPanel id="sujetMP" ajaxRendered="true" rendered="false">

                      <h:message for="sujetI" infoClass="champValide" styleClass="champInvalide" rendered="true"/>

                  </a4j:outputPanel>

       

       

                  <h:outputText value="#{msg['message.corps']}" />

                  <a4j:outputPanel id="corps">

                      <h:inputTextarea id="corpsI"

                                       value="#{contactView.message.corpsMessage}"

                                       cols="25"

                                       rows="5"

                                       required="true"

                                       requiredMessage="#{msg['message.valeurRequise.corps']}"

                                       validatorMessage="#{msg['message.erreur.corps']}"

                                       binding="#{contactView.bb.corpsI}">

                          <f:validateLength minimum="15" maximum="1000" />

                      </h:inputTextarea>

                  </a4j:outputPanel>

                  <a4j:outputPanel id="corpsMP" ajaxRendered="true" >

                      <h:message for="corpsI" infoClass="champValide" styleClass="champInvalide" style="vertical-align: top"/>

                  </a4j:outputPanel>

       

       

                  <a4j:outputPanel rendered="false">

                      <h:outputText value="#{msg['message.texte.recopier']}" />

                  </a4j:outputPanel>

                  <a4j:outputPanel id="captchaImage" ajaxRendered="true" style="min-height:50px;min-width:150px;" rendered="false">

                      <h:graphicImage value="/CaptchaServlet?param=#{contactView.now}&amp;locale=#{view.locale.language}" height="50" width="150" alt="#{msg['message.texte.recopier']}" title="#{msg['message.texte.recopier']}"/>

                  </a4j:outputPanel>

                  <a4j:outputPanel rendered="false"/>

       

       

                  <a4j:outputPanel rendered="false">

                      <h:outputText value="#{msg['message.recopier.ici']}" />

                  </a4j:outputPanel>

                  <a4j:outputPanel id="secureText" rendered="false">

                      <h:inputText id="secureTextI" value="#{contactView.secureText}" validatorMessage="#{msg['message.captcha.requis']}" requiredMessage="#{msg['message.captcha.requis']}" maxlength="50" size="20" required="true" binding="#{contactView.bb.secureTextI}">

                          <f:validator validatorId="captchaValidator" />

                      </h:inputText>

                  </a4j:outputPanel>

                  <a4j:outputPanel id="secureTextMP" rendered="false">

                      <h:message for="secureTextI" styleClass="champInvalide" />

                  </a4j:outputPanel>

                  <a4j:outputPanel layout="block" styleClass="formulaireContactLoader">

                      <ui:include src="status-bar.xhtml"/>

                  </a4j:outputPanel>

                  <a4j:outputPanel layout="block" styleClass="formulaireContactFooter">

                      <a4j:commandButton id="envoyerMessage" action="#{contactView.envoyer}" type="submit" render="formulaireContactP" value="#{msg['message.envoyer']}" styleClass="form-button" >

                          <!--<f:ajax execute="@form" listener="#{contactView.valider}" event="click" render="formulaireContactP"/>-->

                      </a4j:commandButton>

                  </a4j:outputPanel>

              </h:panelGrid>

              <a4j:outputPanel>

                  <h:message for="envoyerMessage" infoClass="champValide"/>

              </a4j:outputPanel>

          </a4j:region>

      </ui:composition>

       

      and the jsf page that includes the form:

       

       

       

      <h:form id="formulaireContact" prependId="false">

      <ui:include src="/WEB-INF/include/formulaire-contact.xhtml"/>

      </h:form>

       

      I would be very grateful for some help...

       

      Thanks in advance,

       

      J.

        • 1. Re: Basic problem with a4j:commandButton and jsf 2.0
          Rocky S Master

          in your browser, view the html code to check if you see id formulaireContact?

           

          should appear in similar fashion as-

           

          <form id="form" name="form" method="post" action="/FaceletsExample/faces/Page.xhtml" enctype="application/x-www-form-urlencoded">

           

          Also remove this commented code out, unless you configured in web.xml to skip comments or use ui:remove around the commented code-

           

          <!--<f:ajax execute="@form" listener="#{contactView.valider}" event="click" render="formulaireContactP"/>-->

          • 2. Re: Basic problem with a4j:commandButton and jsf 2.0
            Julien Martin Expert

            Thanks a lot for taking the time to reply,

            I removed the commented code as you advised. Here is the html source code:

             


            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

            <html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr"><head><link type="text/css" rel="stylesheet" href="/jeanbaptistemartin/rfRes/skinning.ecss.jsf?db=eAHL6rC8BQAEkAIG" /><script type="text/javascript" src="/jeanbaptistemartin/javax.faces.resource/jsf.js.jsf?ln=javax.faces"></script><script type="text/javascript" src="/jeanbaptistemartin/javax.faces.resource/jquery.js.jsf"></script><script type="text/javascript" src="/jeanbaptistemartin/javax.faces.resource/richfaces.js.jsf"></script><script type="text/javascript" src="/jeanbaptistemartin/javax.faces.resource/richfaces-queue.js.jsf"></script><script type="text/javascript" src="/jeanbaptistemartin/javax.faces.resource/richfaces-base-component.js.jsf"></script><script type="text/javascript" src="/jeanbaptistemartin/javax.faces.resource/status.js.jsf?ln=org.richfaces"></script>

                            <title lang="fr">Contact / Jean-Baptiste Martin Sculptures

                            </title>

                            <meta name="description" content="Comment contacter Jean-Baptiste Martin." lang="fr" />

                    <meta name="keywords" content="Jean-Baptiste Martin, sculpture, sculpteur, oeuvre, bronze, portrait, statue, tête, visage, plâtre, moule, moulage, fonte, modèle, modelage, nu" lang="fr" />

                    <link rel="icon" type="image/png" href="/jeanbaptistemartin/images/favicon-32x32.png" />

                    <link rel="stylesheet" href="/jeanbaptistemartin/css/screen.css" type="text/css" media="screen" />

                    <link rel="stylesheet" href="/jeanbaptistemartin/css/layout.css" type="text/css" media="screen" />

                    <link rel="stylesheet" href="/jeanbaptistemartin/css/carousel.css" type="text/css" media="screen" /></head>

                <body>

                    <div class="maincontainer">

                        <div class="top">

                            <div class="bandeau"><a href="/jeanbaptistemartin/lang/fr/" id="j_idt12" class="bandeau">

                                    <img src="/jeanbaptistemartin/images/bandeau.jpg" class="bandeau" width="1024" height="147" /></a>

                            </div>

                            <div id="menu">

                                <span id="locale-component"><a href="/jeanbaptistemartin/lang/fr/contact" id="j_idt16" hreflang="fr" lang="fr">Français</a> | <a href="/jeanbaptistemartin/lang/en/contact" id="j_idt20" hreflang="en" lang="en">English</a></span>

                <ul>

                        <li><a href="/jeanbaptistemartin/lang/fr/" id="accueil">Accueil</a></li>

                        <li><a href="/jeanbaptistemartin/lang/fr/galerie" id="galerie">Galerie</a></li>

                        <li><a href="/jeanbaptistemartin/lang/fr/biographie" id="biographie">Biographie</a></li>

                        <li><a href="/jeanbaptistemartin/lang/fr/commandes-personnalisees" id="commandes-personnalisees">Commandes personnalisées</a></li>

                        <li><a href="/jeanbaptistemartin/lang/fr/alertes" id="alertes">Alertes</a></li>

                        <li id="active"><a href="#" id="current">Contact</a></li>

                        <li><a href="/jeanbaptistemartin/lang/fr/liens" id="liens">Liens</a></li>

                </ul>

                            </div>

                        </div>

                        <div class="contentwrapper">

                            <div class="contentcolumn">

                                <div class="innertube"><span id="j_idt90">

                                <ul id="breadcrumb">

                                    <li><strong><a href="/jeanbaptistemartin/lang/fr/" id="j_idt92">Accueil</a></strong></li>

                                    <li><strong>Contact</strong></li>

                                </ul></span>

                            <span class="sculpture-illustration">

                                <img src="/jeanbaptistemartin/images/illustrations/nue_015_illustration.jpg" />

                            </span><div id="wrapper" class="wrapper">

                                <br /><span id="j_idt100">Vous pouvez contacter Jean-Baptiste Martin :

                                    <ul>

                                        <li>par courrier :

                                            <ul><li>Jean-Baptiste Martin. La Grifolle Basse, 63590, Auzelles, France</li></ul>

                                        </li>

                                        <li>par téléphone :<ul>

                                                    <li>04 73 72 08 79</li>

                                            </ul> </li>

                                        <li>par email :

                                            <ul>

                                                <li>en remplissant ce formulaire :

                                                    <br /><br />

            <form id="formulaireContact" name="formulaireContact" method="post" action="/jeanbaptistemartin/lang/fr/contact" enctype="application/x-www-form-urlencoded">

            <input type="hidden" name="formulaireContact" value="formulaireContact" />

            <table id="formulaireContactP">

            <tbody>

            <tr>

            <td class="libellesColonne">Votre email</td>

            <td class="champsColonne"><span id="fromEmail"><input id="email" type="text" name="email" class="emailI" maxlength="50" size="20" onclick="mojarra.ab(this,event,'click',0,0);return false" /></span></td>

            <td class="validiteColonne"><span id="emailMP"></span></td>

            </tr>

            <tr>

            <td class="libellesColonne">Votre nom</td>

            <td class="champsColonne"><span id="nom"><input id="nomI" type="text" name="nomI" class="nomI" maxlength="50" size="20" onchange="mojarra.ab(this,event,'valueChange',0,'nom nomMP')" /></span></td>

            <td class="validiteColonne"><span id="nomMP"></span></td>

            </tr>

            <tr>

            <td class="libellesColonne">Message</td>

            <td class="champsColonne"><span id="corps"><textarea id="corpsI" name="corpsI" cols="25" rows="5"></textarea></span></td>

            <td class="validiteColonne"><span id="corpsMP"></span></td>

            </tr>

            <tr>

            <td class="libellesColonne"><div id="j_idt135" class="formulaireContactLoader"><span id="j_idt136"><span style="display:none" class="rich-status-start"><img src="/jeanbaptistemartin/images/ajax-loader-bar.gif" alt="" /></span><span class="rich-status-stop"></span><script type="text/javascript">

            //<![CDATA[

            new RichFaces.ui.Status("j_idt136")

            //]]>

            </script> </span></div></td>

            <td class="champsColonne"><div id="j_idt138" class="formulaireContactFooter"><input id="envoyerMessage" name="envoyerMessage" onclick="RichFaces.ajax(&quot;envoyerMessage&quot;,event,{&quot;incId&quot;:&quot;1&quot;} );return false;" value="Envoyer" class="form-button" type="submit" /></div></td>

            </tr>

            </tbody>

            </table>

            <span id="j_idt139"></span><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="4025767909863694926:-1151536073772837604" autocomplete="off" />

            </form>

                                                </li>

                                            </ul>

                                        </li>

                                    </ul></span></div>

                                </div>

                            </div>

                        </div>

                        <div class="leftcolumn">

                            <div class="innertube">

                               

                            </div>

                        </div>

                        <div class="push"></div>

                    </div>


                    <div class="footer">

                        <div class="innertube">

                            <p>Jean-Baptiste Martin. La Grifolle Basse, 63590, Auzelles, France. <span style="font-size:smaller;">(Version du site : 2.0)</span>

                            </p>

                        </div>

                    </div>

                </body>

            </html>

             

             

             

            I am experiencing the same problem as before unfortunately...

            Any other idea?

            J.

            • 3. Basic problem with a4j:commandButton and jsf 2.0
              Rocky S Master

              try this, change the scope of your managed bean from request to session.

              • 4. Basic problem with a4j:commandButton and jsf 2.0
                Julien Martin Expert

                Amam S,

                I tried. It doesn't make any difference either. I have the same problem...

                J.

                • 5. Basic problem with a4j:commandButton and jsf 2.0
                  Nick Belaevski Master

                  Hi Julien,

                   

                  Does the action work when you use h:commandLink?

                  • 6. Basic problem with a4j:commandButton and jsf 2.0
                    Julien Martin Expert

                    Hello Nick,

                    No it does not...

                    J.

                    • 7. Basic problem with a4j:commandButton and jsf 2.0
                      Ilya Shaikovsky Master

                      Try to add simple phasetracker which will just output Lifecycle phases executed to console. if the lifecycle execution interrupted at phase 2-4 and going to render responce that means that conversion/validation/model update problem occured and you just missing messages for some components  or global ones which should output that.

                      • 8. Basic problem with a4j:commandButton and jsf 2.0
                        Julien Martin Expert

                        Hello Ilya!

                        Thanks for your reply.

                         

                        It's very strange. All phases get executed as shown here:

                         

                        DEBUG [08:59:57,844] (TracePhaseListener.java:24) - beforePhase

                        DEBUG [08:59:57,844] (TracePhaseListener.java:25) - APPLY_REQUEST_VALUES 2

                        DEBUG [08:59:57,844] (TracePhaseListener.java:18) - afterPhase

                        DEBUG [08:59:57,844] (TracePhaseListener.java:19) - APPLY_REQUEST_VALUES 2

                        DEBUG [08:59:57,844] (TracePhaseListener.java:24) - beforePhase

                        DEBUG [08:59:57,845] (TracePhaseListener.java:25) - PROCESS_VALIDATIONS 3

                        DEBUG [08:59:57,845] (TracePhaseListener.java:18) - afterPhase

                        DEBUG [08:59:57,846] (TracePhaseListener.java:19) - PROCESS_VALIDATIONS 3

                        DEBUG [08:59:57,846] (TracePhaseListener.java:24) - beforePhase

                        DEBUG [08:59:57,846] (TracePhaseListener.java:25) - UPDATE_MODEL_VALUES 4

                        DEBUG [08:59:57,846] (TracePhaseListener.java:18) - afterPhase

                        DEBUG [08:59:57,846] (TracePhaseListener.java:19) - UPDATE_MODEL_VALUES 4

                        DEBUG [08:59:57,847] (TracePhaseListener.java:24) - beforePhase

                        DEBUG [08:59:57,847] (TracePhaseListener.java:25) - INVOKE_APPLICATION 5

                        DEBUG [08:59:57,847] (TracePhaseListener.java:18) - afterPhase

                        DEBUG [08:59:57,847] (TracePhaseListener.java:19) - INVOKE_APPLICATION 5

                        DEBUG [08:59:57,847] (TracePhaseListener.java:24) - beforePhase

                        DEBUG [08:59:57,847] (TracePhaseListener.java:25) - RENDER_RESPONSE 6

                        DEBUG [08:59:57,856] (ContactView.java:129) - getBb

                        DEBUG [08:59:57,857] (ContactView.java:129) - getBb

                        DEBUG [08:59:57,858] (ContactView.java:129) - getBb

                        DEBUG [08:59:57,859] (ContactView.java:129) - getBb

                        DEBUG [08:59:57,860] (ContactView.java:129) - getBb

                        DEBUG [08:59:57,880] (ContactView.java:89) - getMessage

                        DEBUG [08:59:57,881] (ContactView.java:89) - getMessage

                        DEBUG [08:59:57,883] (ContactView.java:89) - getMessage

                        DEBUG [08:59:57,888] (TracePhaseListener.java:18) - afterPhase

                        DEBUG [08:59:57,888] (TracePhaseListener.java:19) - RENDER_RESPONSE 6

                         

                        Any other idea where I should look to?

                        J.

                        • 9. Basic problem with a4j:commandButton and jsf 2.0
                          Julien Martin Expert

                          up

                          Can anyone please help?

                          J.

                          • 10. Basic problem with a4j:commandButton and jsf 2.0
                            Nick Belaevski Master

                            Julien,

                             

                            Can you please try this: <h:form id="formulaireContact" prependId="true">?

                            • 11. Basic problem with a4j:commandButton and jsf 2.0
                              Julien Martin Expert

                              Hello Nick,

                              I tried as suggested and yet it exhibits the same behaviour.

                              I am at a loss on what to try next...

                              Julien.

                               

                              P.S

                              Here is a snippet to show you I turned on prependId:

                              <input id="formulaireContact:email" type="text" name="formulaireContact:email" class="emailI" maxlength="50" size="20" />

                              • 12. Basic problem with a4j:commandButton and jsf 2.0
                                Rocky S Master

                                could you list your all richfaces jar files names, you are using?

                                • 13. Basic problem with a4j:commandButton and jsf 2.0
                                  Julien Martin Expert

                                  Hello Aman!

                                  Here is my pom.xml:

                                   

                                  <?xml version="1.0" encoding="UTF-8"?>

                                  <project

                                          xmlns="http://maven.apache.org/POM/4.0.0"

                                          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                                          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

                                      <modelVersion>4.0.0</modelVersion>

                                      <groupId>com.jeanbaptistemartin</groupId>

                                      <artifactId>jeanbaptistemartin</artifactId>

                                      <packaging>war</packaging>

                                      <version>2.0</version>

                                      <name>jeanbaptistemartin.com</name>

                                      <url>http://maven.apache.org</url>

                                      <dependencies>

                                          <dependency>

                                              <groupId>junit</groupId>

                                              <artifactId>junit</artifactId>

                                              <version>4.8.2</version>

                                              <scope>test</scope>

                                          </dependency>

                                          <dependency>

                                              <groupId>com.ocpsoft</groupId>

                                              <artifactId>prettyfaces-jsf2</artifactId>

                                              <version>3.2.0</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.hibernate</groupId>

                                              <artifactId>hibernate-core</artifactId>

                                              <version>3.5.4-Final</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.hibernate</groupId>

                                              <artifactId>hibernate-annotations</artifactId>

                                              <version>3.4.0.GA</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.hibernate</groupId>

                                              <artifactId>hibernate-entitymanager</artifactId>

                                              <version>3.4.0.GA</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.hibernate</groupId>

                                              <artifactId>hibernate-commons-annotations</artifactId>

                                              <version>3.3.0.ga</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.hibernate</groupId>

                                              <artifactId>hibernate-validator</artifactId>

                                              <version>4.0.2.GA</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>javassist</groupId>

                                              <artifactId>javassist</artifactId>

                                              <version>3.4.GA</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.slf4j</groupId>

                                              <artifactId>slf4j-log4j12</artifactId>

                                              <version>1.5.2</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>net.sf.ehcache</groupId>

                                              <artifactId>ehcache</artifactId>

                                          </dependency>

                                          <dependency>

                                              <groupId>c3p0</groupId>

                                              <artifactId>c3p0</artifactId>

                                              <version>0.9.1.2</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>concurrent</groupId>

                                              <artifactId>concurrent</artifactId>

                                              <version>1.3.4</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>log4j</groupId>

                                              <artifactId>log4j</artifactId>

                                              <version>1.2.16</version>

                                          </dependency>

                                    

                                          <dependency>

                                              <groupId>com.sun.faces</groupId>

                                              <artifactId>jsf-api</artifactId>

                                          </dependency>

                                          <dependency>

                                              <groupId>com.sun.faces</groupId>

                                              <artifactId>jsf-impl</artifactId>

                                          </dependency>

                                    

                                          <!--

                                          <dependency>

                                              <groupId>com.sun.faces</groupId>

                                              <artifactId>jsf-api</artifactId>

                                              <version>2.0.4-b03</version>

                                   

                                          </dependency>

                                          <dependency>

                                              <groupId>com.sun.faces</groupId>

                                              <artifactId>jsf-impl</artifactId>

                                              <version>2.0.4-b03</version>

                                   

                                          </dependency>

                                  -->

                                          <dependency>

                                              <groupId>org.richfaces.ui</groupId>

                                              <artifactId>richfaces-components-ui</artifactId>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.richfaces.core</groupId>

                                              <artifactId>richfaces-core-impl</artifactId>

                                          </dependency>

                                         

                                          <dependency>

                                              <groupId>org.springframework</groupId>

                                              <artifactId>spring-core</artifactId>

                                              <version>${spring.version}</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.springframework</groupId>

                                              <artifactId>spring-web</artifactId>

                                              <version>${spring.version}</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.springframework</groupId>

                                              <artifactId>spring-beans</artifactId>

                                              <version>${spring.version}</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.springframework</groupId>

                                              <artifactId>spring-context</artifactId>

                                              <version>${spring.version}</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.springframework</groupId>

                                              <artifactId>spring-aop</artifactId>

                                              <version>${spring.version}</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.springframework</groupId>

                                              <artifactId>spring-context-support</artifactId>

                                              <version>${spring.version}</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.springframework</groupId>

                                              <artifactId>spring-tx</artifactId>

                                              <version>${spring.version}</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.springframework</groupId>

                                              <artifactId>spring-orm</artifactId>

                                              <version>${spring.version}</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.springframework</groupId>

                                              <artifactId>spring-jdbc</artifactId>

                                              <version>${spring.version}</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.springframework</groupId>

                                              <artifactId>spring-test</artifactId>

                                              <version>${spring.version}</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.springframework</groupId>

                                              <artifactId>spring-webmvc</artifactId>

                                              <version>${spring.version}</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>org.springframework</groupId>

                                              <artifactId>spring-web</artifactId>

                                              <version>${spring.version}</version>

                                          </dependency>

                                   

                                          <dependency>

                                              <groupId>mysql</groupId>

                                              <artifactId>mysql-connector-java</artifactId>

                                              <version>5.1.13</version>

                                          </dependency>

                                   

                                          <dependency>

                                              <groupId>javax.mail</groupId>

                                              <artifactId>mail</artifactId>

                                              <version>1.4.3</version>

                                          </dependency>

                                   

                                          <dependency>

                                              <groupId>javax.servlet</groupId>

                                              <artifactId>servlet-api</artifactId>

                                              <scope>provided</scope>

                                          </dependency>

                                   

                                          <dependency>

                                              <groupId>com.octo.captcha</groupId>

                                              <artifactId>jcaptcha</artifactId>

                                              <version>1.0</version>

                                              <exclusions>

                                                  <exclusion>

                                                      <artifactId>servlet-api</artifactId>

                                                      <groupId>javax.servlet</groupId>

                                                  </exclusion>

                                              </exclusions>

                                          </dependency>

                                   

                                          <!--

                                          <dependency>

                                              <groupId>xerces</groupId>

                                              <artifactId>xerces</artifactId>

                                              <version>2.4.0</version>

                                          </dependency>

                                          -->

                                          <dependency>

                                              <groupId>xerces</groupId>

                                              <artifactId>xercesImpl</artifactId>

                                              <version>2.9.1</version>

                                          </dependency>

                                   

                                          <dependency>

                                              <groupId>xerces</groupId>

                                              <artifactId>xmlParserAPIs</artifactId>

                                              <version>2.6.2</version>

                                          </dependency>

                                          <dependency>

                                              <groupId>commons-collections</groupId>

                                              <artifactId>commons-collections</artifactId>

                                              <version>3.2.1</version>

                                   

                                          </dependency>

                                          <dependency>

                                              <groupId>javax.annotation</groupId>

                                              <artifactId>jsr250-api</artifactId>

                                              <version>1.0</version>

                                   

                                          </dependency>

                                          <dependency>

                                              <groupId>org.apache.velocity</groupId>

                                              <artifactId>velocity</artifactId>

                                              <version>1.6.4</version>

                                   

                                          </dependency>

                                          <dependency>

                                              <groupId>org.freemarker</groupId>

                                              <artifactId>freemarker</artifactId>

                                              <version>2.3.16</version>

                                          </dependency>

                                   

                                          <!--

                                          <dependency>

                                              <groupId>taglibs</groupId>

                                              <artifactId>standard</artifactId>

                                              <version>1.1.2</version>

                                          </dependency>

                                   

                                          <dependency>

                                              <groupId>javax.servlet</groupId>

                                              <artifactId>jstl</artifactId>

                                          </dependency>

                                          -->

                                   

                                          <dependency>

                                              <groupId>net.sourceforge.jwebunit</groupId>

                                              <artifactId>jwebunit-htmlunit-plugin</artifactId>

                                              <version>2.4</version>

                                              <scope>test</scope>

                                          </dependency>

                                          <dependency>

                                              <groupId>com.jeanbaptistemartin</groupId>

                                              <artifactId>jbm-domain</artifactId>

                                              <version>2.0</version>

                                          </dependency>

                                      </dependencies>

                                      <build>

                                          <plugins>

                                              <plugin>

                                                  <groupId>org.apache.maven.plugins</groupId>

                                                  <artifactId>maven-compiler-plugin</artifactId>

                                                  <configuration>

                                                      <source>1.6</source>

                                                      <target>1.6</target>

                                                  </configuration>

                                              </plugin>

                                              <plugin>

                                                  <groupId>org.apache.maven.plugins</groupId>

                                                  <artifactId>maven-war-plugin</artifactId>

                                                  <configuration>

                                                      <webResources>

                                                          <webResource>

                                                              <directory>${basedir}/src/main/webapp/WEB-INF</directory>

                                                              <includes>

                                                                  <include>web.xml</include>

                                                              </includes>

                                                              <targetPath>WEB-INF</targetPath>

                                                              <filtering>true</filtering>

                                                          </webResource>

                                                      </webResources>

                                                  </configuration>

                                              </plugin>

                                          </plugins>

                                          <finalName>ROOT</finalName>

                                      </build>

                                      <repositories>

                                          <repository>

                                              <id>unknown-jars-temp-repo</id>

                                              <name>A temporary repository created by NetBeans for libraries and jars it could not identify. Please replace the dependencies in this repository with correct ones and delete this repository.</name>

                                              <url>file:${project.basedir}/lib</url>

                                          </repository>

                                      </repositories>

                                      <properties>

                                          <spring.version>3.0.5.RELEASE</spring.version>

                                          <netbeans.hint.deploy.server>Tomcat60</netbeans.hint.deploy.server>

                                          <org.richfaces.bom.version>4.0.0.20110227-CR1</org.richfaces.bom.version>

                                        

                                      </properties>

                                      <dependencyManagement>

                                          <dependencies>

                                              <dependency>

                                                  <groupId>org.richfaces</groupId>

                                                  <artifactId>richfaces-bom</artifactId>

                                                  <version>${org.richfaces.bom.version}</version>

                                                  <scope>import</scope>

                                                  <type>pom</type>

                                              </dependency>

                                          </dependencies>

                                      </dependencyManagement>

                                   

                                  </project>

                                  • 14. Basic problem with a4j:commandButton and jsf 2.0
                                    Julien Martin Expert

                                    SORTED!!

                                     

                                    My mistake: this was causing a problem:

                                     

                                        @URLAction

                                        public String contact() {

                                            log.debug("contact");

                                            return "/contact.xhtml";

                                        }

                                     

                                    After removing it. It now works fine.

                                    J.