bonjour tout le monde
j'ai un problème avec la page welcome 'page d’accueil ' avec login si le nom et mot de passe correct alors rediriger vers la page welcome.xhtml
je vous montre code source de l'application
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
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
 
<?xml version="1.0"?>
<web-app version="3.0" 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_3_0.xsd">
 
 
  <display-name>mus</display-name>
<welcome-file-list>
    <welcome-file>welcome.xhtml</welcome-file>
</welcome-file-list>  
 <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>*.xhtml</url-pattern>
        </servlet-mapping>
 <filter>
    <filter-name>LogFilter</filter-name>
    <filter-class>
        LoginFilter
    </filter-class>
 
</filter>
<filter-mapping>
    <filter-name>LogFilter</filter-name>
    <url-pattern>/test/*</url-pattern>
</filter-mapping>
 	
 
<security-constraint> 
    <web-resource-collection> 
          <web-resource-name>security</web-resource-name>
            <description>Declarative security tests</description>
            <url-pattern>/test/*</url-pattern>
            <http-method>HEAD</http-method>
            <http-method>GET</http-method>
            <http-method>POST</http-method>
            <http-method>PUT</http-method>
            <http-method>DELETE</http-method>
 </web-resource-collection> 
 
    <auth-constraint>
   <role-name>admin</role-name>
  </auth-constraint>
</security-constraint> 
 
<login-config> 
    <auth-method>FORM</auth-method> 
    <realm-name>MyDomain</realm-name>
    <form-login-config> 
        <form-login-page>/test/entrer.xhtml</form-login-page> 
        <form-error-page>/test/erreur.xhtml</form-error-page> 
    </form-login-config> 
</login-config>
 
<security-role>
  <role-name>admin</role-name>
 </security-role>
<session-config>
<session-timeout>1</session-timeout>
</session-config>
 
</web-app>
et la page entrer.xhtml

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
 
<!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:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
 
	   <h:head>
        <title>Login page</title>
    </h:head>
    <h:body>
 
        <h1>Login page</h1>
 
        <form method="post" action="j_security_check">
            Login<br/>
            <h:inputText id="j_username" label="Login" required="true"/>
            <br/>Password<br/>
            <h:inputSecret id="j_password" label="password" required="true"/>
            <br/><h:commandButton value="Valider"  action="#{User.authenticate()}"/>
        </form>
    </h:body>
</html>
je voudrais savoir comment je peu rediriger le résultat de l’exécution de cette action"http://localhost:8080/mus/test/voir.xhtml" vers la page welcome.xhtml.

merci d'avance