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 :

[Ajax4j][RichFaces] problème d'installation


Sujet :

JSF Java

  1. #1
    Membre éclairé
    Profil pro
    Inscrit en
    Février 2007
    Messages
    382
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 382
    Par défaut [Ajax4j][RichFaces] problème d'installation
    Bonjour,

    je souhaite rajouter le support de ajax4j et RichFaces à un projet JSF + Fcelet
    Dans un premier temps je souhaite déjà rajouter ajax4j mais j'ai un problème.

    j'ai le fichier web.xml suivant
    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
    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
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
     
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" 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-app_2_5.xsd">
     
        <!--
            CONFIGURATION DE JSF
        -->
        <context-param>
            <param-name>com.sun.faces.verifyObjects</param-name>
            <param-value>true</param-value>
        </context-param>
        <context-param>
            <param-name>com.sun.faces.validateXml</param-name>
            <param-value>true</param-value>
        </context-param>
        <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>*.html</url-pattern>
        </servlet-mapping>
     
        <!--
            CONFIGURATION DE FACELETS
        -->
        <context-param>
            <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
            <param-value>.xhtml</param-value>
        </context-param>
        <context-param>
            <param-name>facelets.DEVELOPMENT</param-name>
            <param-value>true</param-value>
        </context-param>
        <context-param>
            <param-name>facelets.SKIP_COMMENTS</param-name>
            <param-value>true</param-value>
        </context-param>
     
        <!--
            CONFIGURATION DE AJAX4J-JSF
        -->
        <context-param>
            <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
            <param-value>false</param-value>
        </context-param>
        <filter>
            <display-name>Ajax4jsf Filter</display-name>
            <filter-name>ajax4jsf</filter-name>
            <filter-class>org.ajax4jsf.Filter</filter-class>
        </filter>
        <context-param>
            <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
            <param-value>com.sun.facelets.FaceletViewHandler</param-value>
        </context-param>
        <filter-mapping>
            <filter-name>ajax4jsf</filter-name>
            <servlet-name>FacesServlet</servlet-name>
            <dispatcher>FORWARD</dispatcher>
            <dispatcher>REQUEST</dispatcher>
            <dispatcher>INCLUDE</dispatcher>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
     
        <!--
            WELCOME WEB GLOBALE
        -->
        <welcome-file-list>
            <welcome-file>forward.jsp</welcome-file>
        </welcome-file-list>
     
        <session-config>
            <session-timeout>30</session-timeout>
        </session-config>
     
    </web-app>
    et le fichier xhtml suivant :
    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
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    <?xml version='1.0' encoding='UTF-8' ?> 
    <!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"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:a4j="http://richfaces.org/a4j">
        <body>
     
            This text above will not be displayed.
     
            <ui:composition template="/template.xhtml">
     
                This text will not be displayed.
     
                <ui:define name="title">
                    <h:form>
                        Name :<h:inputText value="#{Secret.name}">
                            <a4j:support event="onkeyup" reRender="rep"/>
                        </h:inputText>
                        Password :<h:inputSecret value="#{Secret.password}" /><br />
                        <h:commandButton action="#{Secret.valider}" value="valider" />
                    </h:form>
                    Facelets
                    <h1 id="rep"></h1>
                </ui:define>
     
                This text will also not be displayed.
     
                <ui:define name="body">
                    Hello from the Facelets client template!
                </ui:define>
     
                This text will not be displayed.
     
            </ui:composition>
     
            This text below will also not be displayed.
     
        </body>
    </html>
    Malheureusement quand j'ouvre ma page interne j'obtient le code suivant :

    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
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    <?xml version='1.0' encoding='UTF-8' ?>
    <!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">
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                <title>Facelets - Template Example</title>
                <link href="./css/default.css" rel="stylesheet" type="text/css" />
            </head>
     
            <body class="toto">
                <h1>
    <form id="j_id55" name="j_id55" method="post" action="/pimty/template-client.html" enctype="application/x-www-form-urlencoded">
    <input type="hidden" name="j_id55" value="j_id55" />
     
                        Name :
                                <a4j:support event="onkeyup" reRender="rep">
     
                                </a4j:support><input type="text" name="j_id55:j_id57" value="dsqsqdqdsqdqsdq" />
                        Password :<input type="password" name="j_id55:j_id60" value="" /><br /><input type="submit" name="j_id55:j_id62" value="valider" />
                        <h1><span id="j_id55:rep">dsqsqdqdsqdqsdq</span></h1><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id1:j_id1" />
    </form>
                    Facelets
                </h1>
                <p>
                    Hello from the Facelets client template!
                </p><script language="javascript" type="text/javascript">
    //<![CDATA[
    function faceletsDebug(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 240,top = 212');"); };var faceletsOrigKeyup = document.onkeyup; document.onkeyup = function(e) { if (window.event) e = window.event; if (String.fromCharCode(e.keyCode) == 'J' & e.shiftKey & e.ctrlKey) faceletsDebug('/pimty/template-client.html?facelets.ui.DebugOutput=1238269833718'); else if (faceletsOrigKeyup) faceletsOrigKeyup(e); };
    //]]>
    </script>
     
     
            </body>
    </html>
    Comme nous pouvons le voir les balises aj4j ne sont pas interprêté. Pourquoi ?

  2. #2
    Rédacteur
    Avatar de romaintaz
    Homme Profil pro
    Java craftsman
    Inscrit en
    Juillet 2005
    Messages
    3 790
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Java craftsman
    Secteur : Finance

    Informations forums :
    Inscription : Juillet 2005
    Messages : 3 790
    Par défaut
    Dans ton web.xml, tu as ça :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
        <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>*.html</url-pattern>
        </servlet-mapping>
    alors que tu devrais avoir quelque chose comme ça :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
        <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>*.jsf</url-pattern>
        </servlet-mapping>
    Nous sommes tous semblables, alors acceptons nos différences !
    --------------------------------------------------------------
    Liens : Blog | Page DVP | Twitter
    Articles : Hudson | Sonar | Outils de builds Java Maven 3 | Play! 1 | TeamCity| CitConf 2009
    Critiques : Apache Maven

  3. #3
    Membre éclairé
    Profil pro
    Inscrit en
    Février 2007
    Messages
    382
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France

    Informations forums :
    Inscription : Février 2007
    Messages : 382
    Par défaut
    Je viens d'essayer mais ça ne change rien !!!!

    Je doit juste renommer mes liens *.html en *.jsf...

Discussions similaires

  1. problème d'installation de richFaces
    Par sal.gass dans le forum JSF
    Réponses: 8
    Dernier message: 05/06/2008, 17h59
  2. problème d'installation du compilateur Borland C++
    Par Hakkou dans le forum Autres éditeurs
    Réponses: 1
    Dernier message: 02/06/2003, 11h02
  3. [SAPdb]Problème d'installation
    Par manou dans le forum SAP
    Réponses: 3
    Dernier message: 17/04/2003, 09h20
  4. Problème d'installation oracle 8.1.7 sous NT
    Par Anonymous dans le forum Installation
    Réponses: 7
    Dernier message: 02/08/2002, 14h18
  5. Réponses: 3
    Dernier message: 26/07/2002, 23h02

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