Bonjour,

J'ai un soucis dans le cadre d'un développement web avec JSF.
Dans mon appli, un formulaire sur la page "index.jsp" appelle un ManagedBean LoginController, qui retourne une String afin d'être redirigé vers une autre page "recherche.jsp".
Le ManagedBean marche bien et retourne correctement la String "loging.complete" mais la page se rafraîchie au lieu d'aller sur l'autre.


voici mon web.xml:

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
 
<?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">
    <context-param>
        <param-name>com.sun.faces.verifyObjects</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>/faces-config.xml</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</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>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>/faces/index.jsp</welcome-file>
    </welcome-file-list>
</web-app>
et mon faces-config.xml:

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
 
<?xml version='1.0' encoding='UTF-8'?>
 
<!-- =========== FULL CONFIGURATION FILE ================================== -->
 
<faces-config version="1.2" 
    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">
    <managed-bean>
        <managed-bean-name>LoginController</managed-bean-name>
        <managed-bean-class>managedbeans.LoginController</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>ExpSearcherController</managed-bean-name>
        <managed-bean-class>managedbeans.ExpSearchingController</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>ExpController</managed-bean-name>
        <managed-bean-class>managedbeans.ExpController</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
 
    <navigation-rule>
        <from-view-id>/faces/index.jsp</from-view-id>
        <navigation-case>
            <from-outcome>loging.fail</from-outcome>
            <to-view-id>/faces/index.jsp</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>loging.complete</from-outcome>
            <to-view-id>/faces/recherche.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>
 
    <navigation-rule>
        <from-view-id>/faces/recherche.jsp</from-view-id>
        <navigation-case>
            <from-outcome>expSearching.complete</from-outcome>
            <to-view-id>/faces/recherche.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>
</faces-config>
Please help me!!