Probleme dans l'affichage avec netbeans
Salut,
J'ai un projet web avec jsf,j'ai une page inscription.jsp et cette page se redirige vers confirm.jsp quand on clique sur le bouton confirmer pour valider le formulaire alors la page confirm.jsp ne s'ouvre pas et toujours reste la page inscription.jsp,et voila les codes:
inscription.jsp
Code:
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
|
<h:form>
<h:outputText value="Nom d'utilisateur *:"/>
<h:inputText value="#{Cli.login} "/><br/>
<h:outputText value="Mot de passe *:"/>
<h:inputSecret value="#{Cli.password} "/><br/>
<br/><br/><br/><br/>
<span class="Style8" >Coordonnees utilisateurs </span>
<hr width="400" color="#000000"><br/>
<h:outputText value="Civilite *:"/>
<h:selectOneRadio value="#{Cli.civilite}" required="true" id="civilite">
<f:selectItem itemLabel="M." itemValue="monsieur"/>
<f:selectItem itemLabel="Mme" itemValue="madame"/>
<f:selectItem itemLabel="Mlle" itemValue="mademoiselle"/>
</h:selectOneRadio>
<h:outputText value="Societe *:"/>
<h:inputText value="#{Cli.societe}"/><br/>
<h:outputText value="Nom *:"/>
<h:inputText value="#{Cli.nom}"/>
<h:outputText value="Prenom *:"/>
<h:inputText value="#{Cli.prenom}"/><br/>
<h:outputText value="Date de naissance *:"/>
<h:inputText value="#{Cli.dateInscription}" id="dateInscription" required="true">
<f:convertDateTime pattern="MM-dd-yyyy"/>
</h:inputText>(mm-dd-yyyy)<br/>
<h:message for="dateInscription"/>
<h:outputText value="Telephone fixe *:"/>
<h:inputText value="#{Cli.fix}"/>
<h:outputText value="Telephone portable *:"/>
<h:inputText value="#{Cli.portable}"/><br/>
<h:outputText value="Fax :"/>
<h:inputText value="#{Cli.fax}"/>
<h:outputText value="Pays *:"/>
<h:inputText value="#{Cli.pays}"/><br/>
<h:outputText value="E-mail *:"/>
<h:inputText value="#{Cli.email}" required="true"
validator="#{Cli.validateEmail}" id="email"/>
<h:message for="email"/><br/>
<h:outputText value="Comment avez-vous connu notre site? *:"/>
<h:selectOneMenu value="#{Cli.source}">
<f:selectItem itemLabel="Par un moteur de recherche sur internet"/>
<f:selectItem itemLabel="Le site web de la societe"/>
<f:selectItem itemLabel="Par un moteur de recherche sur internet"/>
<f:selectItem itemLabel="Par un ami"/>
<f:selectItem itemLabel="Autre"/>
</h:selectOneMenu><br/><br/>
<h:outputText value="Adresse:" styleClass="Style8"/><br/>
<h:outputText value="adresse *:"/>
<h:inputText value="#{Cli.adresse}"/>
<h:outputText value="Code postal *:"/>
<h:inputText value="#{Cli.postal}"/><br/>
<h:outputText value="Ville *:"/>
<h:inputText value="#{Cli.ville}"/><br/>
<h:commandButton value="confirmer" action="valider"/>
</h:form> |
confirm.jsp
Code:
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
|
<h:form>
<p class="Style8"><br/><br/>Bienvenue<h:outputText value="#{Cli.login}"/><br/> </p>
<h:outputText value="Veuillez verifier vos informations:"/><br/>
<h:outputText value="Nom :"/>
<h:outputText value="#{Cli.nom}"/><br/>
<h:outputText value="Prenom:"/>
<h:outputText value="#{Cli.prenom}"/><br/>
<h:outputText value="Civilite :#{Cli.civilite}"/>
<h:outputText value="Societe :"/>
<h:outputText value="#{Cli.societe}"/><br/>
<h:outputText value="#{Cli.dateInscription}"/><br/>
<h:outputText value="#{Cli.fix}"/><br/>
<h:outputText value="#{Cli.portable}"/><br/>
<h:outputText value="#{Cli.fax}"/><br/>
<h:outputText value="#{Cli.pays}"/><br/>
<h:outputText value="#{Cli.email}"/><br/>
<h:outputText value="#{Cli.source}"/><br/>
<h:outputText value="#{Cli.adresse}"/><br/>
<h:outputText value="#{Cli.postal}"/><br/>
<h:outputText value="#{Cli.ville}"/><br/>
</h:form> |
et voila le fichier de configuration
faces.config.xml
Code:
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
|
<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">
<navigation-rule>
<from-view-id>/main.jsp</from-view-id>
<navigation-case>
<from-outcome>inscrire</from-outcome>
<to-view-id>/inscription.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/inscription.jsp</from-view-id>
<navigation-case>
<from-outcome>valider</from-outcome>
<to-view-id>/confirm.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<managed-bean>
<managed-bean-name>Cli</managed-bean-name>
<managed-bean-class>Cli</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config> |
et enfin voila le bean manage Cli.java
Code:
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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author jamal
*/
import java.util.Date;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.ValidatorException;
public class Cli {
String login;
String password;
String nom;
String prenom;
String adresse;
String ville;
String pays;
Integer fix;
Integer portable;
Date dateInscription;
Integer idProduit;
String message;
Integer fax;
Integer postal;
String source;
String civilite;
String commentaires;
String societe;
String email;
/** Creates a new instance of Cli */
public Cli() {
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getAdresse() {
return adresse;
}
public void setAdresse(String adresse) {
this.adresse = adresse;
}
public String getVille() {
return ville;
}
public void setVille(String ville) {
this.ville = ville;
}
public String getPays() {
return pays;
}
public void setPays(String pays) {
this.pays = pays;
}
public Integer getFix() {
return fix;
}
public void setFix(Integer fix) {
this.fix = fix;
}
public Integer getPortable() {
return portable;
}
public void setPortable(Integer portable) {
this.portable = portable;
}
public Date getDateInscription() {
return dateInscription;
}
public void setDateInscription(Date dateInscription) {
this.dateInscription = dateInscription;
}
public Integer getIdProduit() {
return idProduit;
}
public void setIdProduit(Integer idProduit) {
this.idProduit = idProduit;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Integer getFax() {
return fax;
}
public void setFax(Integer fax) {
this.fax = fax;
}
public Integer getPostal() {
return postal;
}
public void setPostal(Integer postal) {
this.postal = postal;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
public String getCivilite() {
return civilite;
}
public void setCivilite(String civilite) {
this.civilite = civilite;
}
public String getCommentaires() {
return commentaires;
}
public void setCommentaires(String commentaires) {
this.commentaires = commentaires;
}
public String getSociete() {
return societe;
}
public void setSociete(String societe) {
this.societe = societe;
}
public void validateEmail(FacesContext context, UIComponent toValidate,Object value) throws ValidatorException {
String eMail = (String) value;
if (eMail.indexOf("@") < 0) {
FacesMessage message = new FacesMessage("Adresse Email invalide !");
throw new ValidatorException(message);
}
}
} |
Pourriez-vous me dire ou est le probleme?
et merci d'avance