IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JSF Java Discussion :

Aide pour richfaces


Sujet :

JSF Java

  1. #1
    Membre du Club
    Inscrit en
    Mai 2009
    Messages
    102
    Détails du profil
    Informations forums :
    Inscription : Mai 2009
    Messages : 102
    Points : 50
    Points
    50
    Par défaut Aide pour richfaces
    bonjour je me met à jsf et j'ai commencé par cet exemple qui ne fonctionne pas
    quelqu'un pourrait bien m'expliquer pourquoi?

    voici mon web.xml:

    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    <?xml version="1.0"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
     
        <display-name>test</display-name>
     
        <description>richfaces test</description>
     
            <context-param>
     
            <param-name>org.richfaces.SKIN</param-name>
     
            <param-value>blueSky</param-value>
     
        </context-param>
     
    <filter> 
       <display-name>RichFaces Filter</display-name> 
       <filter-name>richfaces</filter-name> 
       <filter-class>org.ajax4jsf.Filter</filter-class> 
    </filter> 
    <filter-mapping> 
       <filter-name>richfaces</filter-name> 
       <servlet-name>Faces Servlet</servlet-name> 
       <dispatcher>REQUEST</dispatcher> 
       <dispatcher>FORWARD</dispatcher> 
       <dispatcher>INCLUDE</dispatcher> 
    </filter-mapping>
     <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
     
        <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>*.jsf</url-pattern>
        </servlet-mapping>
     <login-config>
    <auth-method>BASIC</auth-method>
    </login-config>
    </web-app>

    la mon faces-config.xml:

    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    <?xml version="1.0" encoding="UTF-8"?>
     
    <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
    	version="1.2">
    <managed-bean> 
         <managed-bean-name>helloBean</managed-bean-name> 
         <managed-bean-class>rich.HelloBean</managed-bean-class> 
         <managed-bean-scope>request</managed-bean-scope> 
         <managed-property>
    <property-name>name</property-name>
    <property-class>java.lang.String</property-class>
    <value/>
    </managed-property>
    </managed-bean>
     
    </faces-config>

    mon bean:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    package rich;
     
    public class HelloBean {
    	private String name; 
    	public HelloBean(){
    		name=" Nobody";
    	}
        public String getName() { 
           return name; 
        } 
     
        public void setName(String name) { 
           this.name = name; 
        } 
     
    }
    J'ai deux pages la pricipale:

    --hello.jsp--

    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
    <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
    <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
    <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Ma page richfaces</title>
    </head>
    <body>
    <f:view>
    <a4j:form>
    <rich:panel header="Test RichFaces" style="width: 350px">
    <h:outputText value="Your name: " />
    <h:inputText value="#{helloBean.name}" >
    <f:validateLength minimum="1" maximum="30" />
    </h:inputText>
    <a4j:commandButton value="Get greeting" reRender="greeting" />
    <h:panelGroup id="greeting" >
    <h:outputText value="Hello, " rendered="#{not empty helloBean.name}" />
    <h:outputText value="#{helloBean.name}" />
    <h:outputText value="!" rendered="#{not empty helloBean.name}" />
    </h:panelGroup>
    </rich:panel>
    </a4j:form>
    </f:view>
    </body>
    </html>

    et l'index
    --index.jsp--

    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Refresh" content= "0; URL=hello.jsf"/>
    <title>Insert title here</title>
    </head>
    <body>
    	Démarage de l'application...
    </body>
    </html>

    Bien sur les librairies que j'utilises sont:

    commons-beanutils-1.7.0.jar
    commons-codec-1.3.jar
    commons-collections-3.2.jar
    commons-digester-1.8.jar
    commons-discovery-0.4.jar
    commons-logging-1.1.1.jar
    myfaces-api-1.2.6.jar
    myfaces-impl-1.2.6.jar
    standard-1.1.2.jar
    jstl-1.2.jar
    et les trois jar de richfaces
    richfaces-api-3.3.0.GA.jar
    richfaces-impl-3.3.0.GA.jar
    richfaces-ui-3.3.0.GA.jar
    je suis sous windows xp sp2
    et donc iexplrer 6.0
    lorsque je lance l'application (http://localhost:8080/richtest/index.jsp) je suis correctement dirigé à la page hello.jsf
    cependant lorsque je click sur le boutton voici l'erreur obtenue:

    An Error Occurred:
    Exception while validating component with path : {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /hello.jsp][Class: org.ajax4jsf.component.html.AjaxForm,Id: j_id_jsp_918357331_1][Class: org.richfaces.component.html.HtmlPanel,Id: j_id_jsp_918357331_2][Class: org.richfaces.component.html.HtmlInputText,Id: j_id_jsp_918357331_4]}

    Caused by:
    org.apache.jasper.el.JspPropertyNotFoundException - /hello.jsp(17,0) '#{helloBean.name}' Target Unreachable, identifier 'helloBean' resolved to null
    +- Stack Trace
    javax.faces.FacesException: Exception while validating component with path : {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /hello.jsp][Class: org.ajax4jsf.component.html.AjaxForm,Id: j_id_jsp_918357331_1][Class: org.richfaces.component.html.HtmlPanel,Id: j_id_jsp_918357331_2][Class: org.richfaces.component.html.HtmlInputText,Id: j_id_jsp_918357331_4]}
    at javax.faces.component.UIInput.validate(UIInput.java:420)
    at javax.faces.component.UIInput.processValidators(UIInput.java:185)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:726)
    at org.ajax4jsf.component.UIAjaxForm.processValidators(UIAjaxForm.java:80)
    at org.ajax4jsf.component.AjaxViewRoot$3.invokeContextCallback(AjaxViewRoot.java:439)
    at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:238)
    at org.ajax4jsf.component.AjaxViewRoot.processValidators(AjaxViewRoot.java:455)
    at org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:32)
    at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:151)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
    at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
    at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
    at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Unknown Source)
    Caused by: org.apache.jasper.el.JspPropertyNotFoundException: /hello.jsp(17,0) '#{helloBean.name}' Target Unreachable, identifier 'helloBean' resolved to null
    at org.apache.jasper.el.JspValueExpression.getType(JspValueExpression.java:61)
    at org.apache.myfaces.shared_impl.renderkit._SharedRendererUtils.findUIOutputConverter(_SharedRendererUtils.java:58)
    at org.apache.myfaces.shared_impl.renderkit.RendererUtils.findUIOutputConverter(RendererUtils.java:391)
    at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getConvertedUIOutputValue(RendererUtils.java:752)
    at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.getConvertedValue(HtmlTextRendererBase.java:219)
    at javax.faces.component.UIInput.getConvertedValue(UIInput.java:455)
    at javax.faces.component.UIInput.validate(UIInput.java:399)
    ... 28 more
    +- Component Tree
    <AjaxViewRoot id=" immediate=" locale=" renderKitId=" renderRegionOnly=" rendered=" selfRendered=" submitted=" transient=" viewId=">
    <AjaxForm ajaxSingle=" ajaxSubmit=" bypassUpdates=" id=" ignoreDupResponses=" limitToList=" prependId=" rendered=" requestDelay=" submitted=" timeout=" transient=">
    <HtmlPanel header=" id=" rendered=" style=" transient=">
    <HtmlOutputText escape=" id=" rendered=" transient=" value="/>
    <HtmlInputText disabled=" id=" immediate=" localValueSet=" maxlength=" readonly=" rendered=" required=" size=" submittedValue=" transient=" valid="/>
    <HtmlAjaxCommandButton ajaxSingle=" bypassUpdates=" disabled=" id=" ignoreDupResponses=" immediate=" limitToList=" reRender=" rendered=" requestDelay=" size=" timeout=" transient=" value="/>
    <HtmlPanelGroup id=" rendered=" transient=">
    <HtmlOutputText escape=" id=" rendered=" transient=" value="/>
    <HtmlOutputText escape=" id=" rendered=" transient="/>
    <HtmlOutputText escape=" id=" rendered=" transient=" value="/>
    </HtmlPanelGroup>
    </HtmlPanel>
    </AjaxForm>
    </AjaxViewRoot>
    +- Scoped Variables
    Request Parameters Name Value
    AJAXREQUEST j_id_jsp_918357331_0
    autoScroll
    j_id_jsp_918357331_1 j_id_jsp_918357331_1
    j_id_jsp_918357331_1:j_id_jsp_918357331_4
    j_id_jsp_918357331_1:j_id_jsp_918357331_5 j_id_jsp_918357331_1:j_id_jsp_918357331_5
    Request Attributes Name Value
    ajaxContext org.ajax4jsf.context.AjaxContextImpl@1c8f91e
    Session Attributes Name Value
    None
    Application Attributes Name Value
    None
    so c'est koi mon problème?????
    Merci de vous y interessé.

  2. #2
    Futur Membre du Club
    Étudiant
    Inscrit en
    Avril 2009
    Messages
    8
    Détails du profil
    Informations personnelles :
    Âge : 38

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2009
    Messages : 8
    Points : 5
    Points
    5
    Par défaut
    Bonsoir,
    bon j'ai tester ton exemple et ça marche parfaitement.
    vraiment j'ai voulu t'aider mais je ne vois pas ou est le problème. en tous cas ton exemple marche.

  3. #3
    Membre du Club
    Inscrit en
    Mai 2009
    Messages
    102
    Détails du profil
    Informations forums :
    Inscription : Mai 2009
    Messages : 102
    Points : 50
    Points
    50
    Par défaut Au secour
    Merci monalisa_smile moi meme je suis plutot depassé. Mais s'il te plait tu peux me donner ta configuration. moi comme je l'ai dis je suis sous eclipse ganymede,tomcat 6, et iexplorer 6. Et le truc c'est que je comprend rien au message d'erreur.

  4. #4
    Membre du Club
    Inscrit en
    Mai 2009
    Messages
    102
    Détails du profil
    Informations forums :
    Inscription : Mai 2009
    Messages : 102
    Points : 50
    Points
    50
    Par défaut Hello
    Au fait dans le cas ou tu utiliserais tomcat,tes librairies sont partagées(dans tomcat) ou se trouvent dans le classpath de l'application?

  5. #5
    Membre du Club
    Inscrit en
    Mai 2009
    Messages
    102
    Détails du profil
    Informations forums :
    Inscription : Mai 2009
    Messages : 102
    Points : 50
    Points
    50
    Par défaut Sorry
    le problème c'est que j'ai mal nommé le fichier faces-config.xml!!!!
    Merci pour l'aide.

  6. #6
    Futur Membre du Club
    Étudiant
    Inscrit en
    Avril 2009
    Messages
    8
    Détails du profil
    Informations personnelles :
    Âge : 38

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2009
    Messages : 8
    Points : 5
    Points
    5
    Par défaut
    désolée de ne pas avoir répondu avant, moi aussi j'ai la meme configuration. heureuse que ta pu régler ton problème et je te souhaite bon courage.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. besoin d'aide pour le composant DBComboBox
    Par jane2002 dans le forum Bases de données
    Réponses: 8
    Dernier message: 28/02/2004, 19h01
  2. [TP]besoin d'aide pour commandes inconnues
    Par Upal dans le forum Turbo Pascal
    Réponses: 15
    Dernier message: 03/10/2002, 10h48
  3. Besoin d'aide pour l'I.A. d'un puissance 4
    Par Anonymous dans le forum C
    Réponses: 2
    Dernier message: 25/04/2002, 17h05
  4. Une petite aide pour les API ?
    Par Yop dans le forum Windows
    Réponses: 2
    Dernier message: 04/04/2002, 21h45

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo