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

Struts 1 Java Discussion :

les caracteres tel que :"é" et "è"ne sont pas connu par ma JSP


Sujet :

Struts 1 Java

  1. #1
    Membre à l'essai
    Inscrit en
    Mai 2007
    Messages
    20
    Détails du profil
    Informations forums :
    Inscription : Mai 2007
    Messages : 20
    Points : 12
    Points
    12
    Par défaut les caracteres tel que :"é" et "è"ne sont pas connu par ma JSP
    bonjour tt le monde,

    Je demande votre aide sur un point :

    voici le code de ma JSP :
    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
    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
     
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ page language="java"%>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Modification des Données du Client</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    body {
    	background-image: url(/GestionClientMeditel/form/images/rouge.jpg);
    }
    .Style1 {
    	color: #FFFFFF;
    	font-weight: bold;
    }
    .Style2 {
    	font-size: 24px;
    	text-decoration: blink;
    }
    -->
    </style></head>
     
    <body>
    <html:form action="clientEdit.do">
      <table width="162" height="88" border="1" align="right">
        <tr>
          <td width="152" height="82"><img src="/GestionClientMeditel/form/images/logo_meditel.jpg" width="152" height="77"></td>
        </tr>
      </table>
      <p>&nbsp; </p>
       <p>&nbsp;</p>
       <table width="379" border="0" align="center">
         <tr>
           <td width="369" class="Style1 Style2">Entrer les nouvelles donn&eacute;es du Client : </td>
         </tr>
       </table>
       <p>&nbsp;</p>
       <p>&nbsp;   </p>
       <table width="688" border="0">
        <tr>
          <td width="177" class="Style1"><strong>Site Name</strong>:</td>
          <td><html:text property="nom"/><html:errors property="nom"/><br/><td/>
          <td width="161">&nbsp;</td>
          <td width="165">&nbsp;</td>
        </tr>
        <tr>
          <td><span class="Style1">Site Street Address</span></td>
          <td><html:text property="adresse"/><html:errors property="adresse"/><br/><td/>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td class="Style1">Site Latitude </td>
          <td><html:text property="latitude"/><html:errors property="latitude"/><br/><td/>
          <td class="Style1">Site Longitude </td>
          <td><html:text property="longitude"/><html:errors property="longitude"/><br/><td/>
        </tr>
        <tr>
          <td class="Style1">Building Height </td>
          <td><html:text property="hauteursite"/><html:errors property="hauteursite"/><br/><td/>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td class="Style1">Contact Name </td>
          <td><html:text property="contactnom"/><html:errors property="contactnom"/><br/><td/>
          <td class="Style1">Contact Tel </td>
          <td><html:text property="contactnum"/><html:errors property="contactnum"/><br/><td/>
        </tr>
        <tr>
          <td class="Style1">Date</td>
          <td><html:text property="dateajout"/><html:errors property="dateajout"/><br/><td/>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
     
          <td><html:select property="besoin">
     
            <html:option  value="Voix IP">Voix IP</html:option>
            <html:option  value="Internet">Internet</html:option>
            <html:option  value="Data">Data</html:option>
            <html:option  value="Voix TDM / Internet">Voix TDM / Internet</html:option>
            <html:option  value="Voix TDM / Data">Voix TDM / Data</html:option>
            <html:option  value="Voix IP / Internet">Voix IP / Internet</html:option>
            <html:option  value="Voix IP / Data">Voix IP / Data</html:option>
            <html:option  value="Internet / Data">Internet / Data</html:option>
            <html:option  value="Voix TDM / Internet / Data">Voix TDM / Internet / Data</html:option>
            <html:option  value="Voix IP / Internet / Data">Voix IP / Internet / Data</html:option>
            </html:select>
            <html:errors property="fonction"/><br/><td/>
     
          <td class="Style1">Capacite</td>
          <td><html:text property="capacite"/><html:errors property="capacite"/><br/><td/>
        </tr>
      <tr>
    <td colspan="1">
    <html:submit>Sauvegarder</html:submit>
    </td>
    </tr>
    <html:hidden property="nom" />
    </table>
    <%-- set the parameter for the dispatch action --%>
    		<html:hidden property="do" value="saveClient" />
    </html:form>
    </div>
    	<div class="bottom"></div>
    						</div>
          </div>
        </div><div id="end_body"></div>
    </body>
    </html>
    qu'on j'entre un des caracteres mentionés : il me donne cette erreur :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    GRAVE: "Servlet.service()" pour la servlet jsp a lancé une exception
    javax.servlet.jsp.JspException: Exception thrown by getter for property nom of bean org.apache.struts.taglib.html.BEAN
    	at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:964)
    	at org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:176)
    je crois que c'est en relation avec le codage utilisée par ma JSP, donc c'est quoi la ligne a modifier et par koi?

    merci d'avance!

  2. #2
    Membre expérimenté Avatar de maxf1
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    1 229
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France, Moselle (Lorraine)

    Informations forums :
    Inscription : Novembre 2006
    Messages : 1 229
    Points : 1 371
    Points
    1 371
    Par défaut
    Ton erreur dit que ta methode getNom te lance une Exception.

    Comme tu ne donnes pas le code de ton form je ne peux t'en dire plus.
    Une solution a été apporté pour résoudre votre problème alors vous aussi faites en profitez les autres grâce au tag qui se trouve tout en bas de la page....

    Merci de ne pas utiliser les messages privés pour un problème sauf si je vous l'ai explicitement demandé.

    -- Maxf1 --

  3. #3
    Membre à l'essai
    Inscrit en
    Mai 2007
    Messages
    20
    Détails du profil
    Informations forums :
    Inscription : Mai 2007
    Messages : 20
    Points : 12
    Points
    12
    Par défaut voici mon form et mon bean
    merci pour ta collaboration :
    je vais maintenant etre + clair :
    J'ai une page JSP pour ajouter un nouveau client :

    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
     
    <%@ page language="java"%>
    <%@ taglib uri='/WEB-INF/struts-bean.tld' prefix='bean'%>
    <%@ taglib uri='/WEB-INF/struts-html.tld' prefix='html'%>
    <%@ taglib uri='/WEB-INF/struts-logic.tld' prefix='logic'%>
     
    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <title>Ajouter un Utilisateur</title>
    </head>
    <body>
    <div id="body_wrapper">
          <div id="body">
            <div id="all">
    					 			<div class="top"></div>
    								<div class="content">
    <html:form action="/clientAdd.do" method="POST">
     
    <table border="0" align="center" width="50%" height="50%">
    	<tr>		
    			<td>nom du Client : <td/>
    			<td><html:text property="nom"/><html:errors property="nom"/><br/><td/>
    	<tr/>
    	<tr>		
    			<td>Adresse: <td/>
    			<td><html:text property="adresse"/><html:errors property="adresse"/><br/><td/>
    	<tr/>
    	<tr>		
    			<td>Besoin : <td/>
    			<td><html:select property="besoin">
    			<html:option  value="voix TDM">voix TDM</html:option>
    			<html:option  value="voix sur IP">voix sur IP</html:option>
    			<html:option  value="Internet">Internet</html:option>
    			<html:option value="Data">Data</html:option></html:select>
    			<html:errors property="fonction"/><br/><td/>
    	<tr/>
    	<tr>	
    			<td>Contact nom : <td/>
    			<td><html:text property="contactnom"/><html:errors property="contactnom"/><br/><td/>
    	<tr/>	
     
    	<tr>	
    			<td>Contact numero : <td/>
    			<td><html:text property="contactnum"/><html:errors property="contactnum"/><br/><td/>
    	<tr/>		
     
     
     
    <tr>
    <td colspan="1">
    <html:submit>Save</html:submit>
    </td>
    </tr>
    </table>
    <input type="hidden" name="request_time" value="<%=System.currentTimeMillis()%>" />
    </html:form>
    </div>
    	<div class="bottom"></div>
    						</div>
          </div>
        </div><div id="end_body"></div>
    </body>
    </html>
    le bean et le form corresponsant :

    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
    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
     
    package com.gestionclientmeditel.persistance;
     
    public class ClientBean implements java.io.Serializable {
     
     
    	private String nom;
    	private String adresse;
    	private String latitude;
    	private String longitude;
    	private String hauteursite;
    	private String contactnom;
    	private String contactnum;
    	private String dateajout;
    	private String besoin;
    	private String capacite;
     
     
    	private int etape;
     
     
     
    	public ClientBean(String nom,String adresse ,String besoin,String contactnom,String contactnum,int etape)
    	{
    		super();
    		this.nom=nom;
    		this.adresse=adresse;
    		this.besoin=besoin;
    		this.contactnom=contactnom;
    		this.contactnum=contactnum;
    		this.etape=etape;
     
    	}
    	public ClientBean(){
    		super();
    	}
     
    	public int getEtape() {
    		return etape;
    	}
    	public void setEtape(int etape){
    		this.etape=etape;
    	}
     
     
     
    	public String getNom() {
    		return nom;
    	}
    	public void setNom(String nom){
    		this.nom=nom;
    	}
    	public String getAdresse() {
    		return adresse;
    	}
    	public void setAdresse(String adresse){
    		this.adresse=adresse;
    	}
     
    	public String getBesoin() {
    		return besoin;
    	}
    	public void setBesoin(String besoin){
    		this.besoin=besoin;
    	}
     
    	public String getContactnom() {
    		return contactnom;
    	}
    	public void setContactnom(String contactnom){
    		this.contactnom=contactnom;
    	}
     
    	public String getContactnum() {
    		return contactnum;
    	}
    	public void setContactnum(String contactnum){
    		this.contactnum=contactnum;
    	}
     
    	/**
             * @return Returns the capacite.
             */
    	public String getCapacite() {
    		return capacite;
    	}
    	/**
             * @param capacite The capacite to set.
             */
    	public void setCapacite(String capacite) {
    		this.capacite = capacite;
    	}
    	/**
             * @return Returns the dateajout.
             */
    	public String getDateajout() {
    		return dateajout;
    	}
    	/**
             * @param dateajout The dateajout to set.
             */
    	public void setDateajout(String dateajout) {
    		this.dateajout = dateajout;
    	}
    	/**
             * @return Returns the hauteursite.
             */
    	public String getHauteursite() {
    		return hauteursite;
    	}
    	/**
             * @param hauteursite The hauteursite to set.
             */
    	public void setHauteursite(String hauteursite) {
    		this.hauteursite = hauteursite;
    	}
    	/**
             * @return Returns the latitude.
             */
    	public String getLatitude() {
    		return latitude;
    	}
    	/**
             * @param latitude The latitude to set.
             */
    	public void setLatitude(String latitude) {
    		this.latitude = latitude;
    	}
    	/**
             * @return Returns the longitude.
             */
    	public String getLongitude() {
    		return longitude;
    	}
    	/**
             * @param longitude The longitude to set.
             */
    	public void setLongitude(String longitude) {
    		this.longitude = longitude;
    	}
    }
    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
     
    <%@ page language="java"%>
    <%@ taglib uri='/WEB-INF/struts-bean.tld' prefix='bean'%>
    <%@ taglib uri='/WEB-INF/struts-html.tld' prefix='html'%>
    <%@ taglib uri='/WEB-INF/struts-logic.tld' prefix='logic'%>
     
    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <title>Ajouter un Utilisateur</title>
    </head>
    <body>
    <div id="body_wrapper">
          <div id="body">
            <div id="all">
    					 			<div class="top"></div>
    								<div class="content">
    <html:form action="/clientAdd.do" method="POST">
     
    <table border="0" align="center" width="50%" height="50%">
    	<tr>		
    			<td>nom du Client : <td/>
    			<td><html:text property="nom"/><html:errors property="nom"/><br/><td/>
    	<tr/>
    	<tr>		
    			<td>Adresse: <td/>
    			<td><html:text property="adresse"/><html:errors property="adresse"/><br/><td/>
    	<tr/>
    	<tr>		
    			<td>Besoin : <td/>
    			<td><html:select property="besoin">
    			<html:option  value="voix TDM">voix TDM</html:option>
    			<html:option  value="voix sur IP">voix sur IP</html:option>
    			<html:option  value="Internet">Internet</html:option>
    			<html:option value="Data">Data</html:option></html:select>
    			<html:errors property="fonction"/><br/><td/>
    	<tr/>
    	<tr>	
    			<td>Contact nom : <td/>
    			<td><html:text property="contactnom"/><html:errors property="contactnom"/><br/><td/>
    	<tr/>	
     
    	<tr>	
    			<td>Contact numero : <td/>
    			<td><html:text property="contactnum"/><html:errors property="contactnum"/><br/><td/>
    	<tr/>		
     
     
     
    <tr>
    <td colspan="1">
    <html:submit>Save</html:submit>
    </td>
    </tr>
    </table>
    <input type="hidden" name="request_time" value="<%=System.currentTimeMillis()%>" />
    </html:form>
    </div>
    	<div class="bottom"></div>
    						</div>
          </div>
        </div><div id="end_body"></div>
    </body>
    </html>
    Supposant j'entre un client avec nom = é
    le client est insere dans ma base et aussi affiche dans la page : listClient.jps :


    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
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
     
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ page language="java"%>
    <%@ taglib uri='/WEB-INF/struts-bean.tld' prefix='bean'%>
    <%@ taglib uri='/WEB-INF/struts-html.tld' prefix='html'%>
    <%@ taglib uri='/WEB-INF/struts-logic.tld' prefix='logic'%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Document sans titre</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    body {
    	background-image:  url(/GestionClientMeditel/form/images/rouge.jpg);
    }
    .Style1 {
    	color: #FFFFFF;
    	font-weight: bold;
    }
    -->
    </style></head>
     
    <body>
    <table width="162" height="88" border="1" align="right">
        <tr>
          <td width="152" height="82"><img src="/GestionClientMeditel/form/images/logo_meditel.jpg" width="152" height="77"></td>
        </tr>
      </table>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <table width="335" border="1" align="center">
      <tr>
        <td width="325"><p class="Style1">LA LISTE DES CLIENTS EN TRAITEMENT </p>    </td>
      </tr>
    </table>
    <p>&nbsp;</p>
    <table width="757" border="1">
      <tr>
        <td class="Style1">CLIENT</td>
        <td class="Style1">ADRESSE</td>
        <td class="Style1">LATITUDE</td>
        <td class="Style1">LONGITUDE</td>
        <td class="Style1">HAUTEUR</td>
        <td class="Style1">CONTACT NOM </td>
        <td class="Style1">CONTACT NUM</td>
        <td class="Style1">DATE AJOUT </td>
        <td class="Style1">BESOIN</td>
        <td class="Style1">CAPACITE</td>
      </tr>
      <logic:empty name="clientForm" property="clients">
    <tr>
    <td colspan="5">Tous Les Clients Sont Servis</td>
    </tr>
    	</logic:empty>
    		<logic:notEmpty name="clientForm" property="clients">
    		<logic:iterate name="clientForm" property="clients" id="client">
    <tr>
     
    			<td width="325"><p class="Style1"><bean:write name="client" property="nom" /></td>
    			<td width="325"><p class="Style1"><bean:write name="client" property="adresse" /></td>
    			<td class="Style1"><bean:write name="client" property="latitude" /></td>
    			<td class="Style1"><bean:write name="client" property="longitude" /></td>
    			<td class="Style1"><bean:write name="client" property="hauteursite" /></td>
    			<td class="Style1"><bean:write name="client" property="contactnom" /></td>
    			<td class="Style1"><bean:write name="client" property="contactnum" /></td>
    			<td class="Style1"><bean:write name="client" property="dateajout" /></td>
    			<td class="Style1"><bean:write name="client" property="besoin" /></td>
    			<td class="Style1"><bean:write name="client" property="capacite" /></td>
     
        <td class="Style1"><html:link action="suivi.do"
     
    			paramName="client"
    			paramProperty="nom"
    			paramId="nom"
    			>Suivi</html:link></td>
     
     
    			<td class="Style1"><html:link action="clientEdit.do?do=editClient"
     
    			paramName="client"
    			paramProperty="nom"
    			paramId="nom"
    			>Modifier</html:link></td>
     
    	<td class="Style1"><html:link action="viewClients.do?do=deleteClient"
    			paramName="client"
    			paramProperty="nom"
    			paramId="nom">Supprimer</html:link></td>
    </tr>
    		</logic:iterate>
    		</logic:notEmpty>
    </table>
    <p>&nbsp;</p>
     
    <div align="center"><span class="Style4"><a href="/GestionClientMeditel/form/menu.jsp" class="Style2">RETOUR AU MENU PRINCIPAL</a> </span></div>
    </body>
    </html>
    Dans ce code y a un lien pour modifier les donnees du client:

    avec comme page :

    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
    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
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ page language="java"%>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Modification des Données du Client</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    body {
    	background-image: url(/GestionClientMeditel/form/images/rouge.jpg);
    }
    .Style1 {
    	color: #FFFFFF;
    	font-weight: bold;
    }
    .Style2 {
    	font-size: 24px;
    	text-decoration: blink;
    }
    -->
    </style></head>
     
    <body>
    <html:form action="clientEdit.do">
      <table width="162" height="88" border="1" align="right">
        <tr>
          <td width="152" height="82"><img src="/GestionClientMeditel/form/images/logo_meditel.jpg" width="152" height="77"></td>
        </tr>
      </table>
      <p>&nbsp; </p>
       <p>&nbsp;</p>
       <table width="379" border="0" align="center">
         <tr>
           <td width="369" class="Style1 Style2">Entrer les nouvelles donn&eacute;es du Client : </td>
         </tr>
       </table>
       <p>&nbsp;</p>
       <p>&nbsp;   </p>
       <table width="688" border="0">
        <tr>
          <td width="177" class="Style1"><strong>Site Name</strong>:</td>
          <td><html:text property="nom"/><html:errors property="nom"/><br/><td/>
          <td width="161">&nbsp;</td>
          <td width="165">&nbsp;</td>
        </tr>
        <tr>
          <td><span class="Style1">Site Street Address</span></td>
          <td><html:text property="adresse"/><html:errors property="adresse"/><br/><td/>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td class="Style1">Site Latitude </td>
          <td><html:text property="latitude"/><html:errors property="latitude"/><br/><td/>
          <td class="Style1">Site Longitude </td>
          <td><html:text property="longitude"/><html:errors property="longitude"/><br/><td/>
        </tr>
        <tr>
          <td class="Style1">Building Height </td>
          <td><html:text property="hauteursite"/><html:errors property="hauteursite"/><br/><td/>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td class="Style1">Contact Name </td>
          <td><html:text property="contactnom"/><html:errors property="contactnom"/><br/><td/>
          <td class="Style1">Contact Tel </td>
          <td><html:text property="contactnum"/><html:errors property="contactnum"/><br/><td/>
        </tr>
        <tr>
          <td class="Style1">Date</td>
          <td><html:text property="dateajout"/><html:errors property="dateajout"/><br/><td/>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
     
          <td><html:select property="besoin">
     
            <html:option  value="Voix IP">Voix IP</html:option>
            <html:option  value="Internet">Internet</html:option>
            <html:option  value="Data">Data</html:option>
            <html:option  value="Voix TDM / Internet">Voix TDM / Internet</html:option>
            <html:option  value="Voix TDM / Data">Voix TDM / Data</html:option>
            <html:option  value="Voix IP / Internet">Voix IP / Internet</html:option>
            <html:option  value="Voix IP / Data">Voix IP / Data</html:option>
            <html:option  value="Internet / Data">Internet / Data</html:option>
            <html:option  value="Voix TDM / Internet / Data">Voix TDM / Internet / Data</html:option>
            <html:option  value="Voix IP / Internet / Data">Voix IP / Internet / Data</html:option>
            </html:select>
            <html:errors property="fonction"/><br/><td/>
     
          <td class="Style1">Capacite</td>
          <td><html:text property="capacite"/><html:errors property="capacite"/><br/><td/>
        </tr>
      <tr>
    <td colspan="1">
    <html:submit>Sauvegarder</html:submit>
    </td>
    </tr>
    <html:hidden property="nom" />
    </table>
    <%-- set the parameter for the dispatch action --%>
    		<html:hidden property="do" value="saveClient" />
    </html:form>
    </div>
    	<div class="bottom"></div>
    						</div>
          </div>
        </div><div id="end_body"></div>
    </body>
    </html>
    voici l'action :
    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
     
    <action
          attribute="clientEditForm"
          name="clientEditForm"
          path="/clientEdit"
          parameter="do"
          validate="false"
          scope="request"
          type="com.gestionclientmeditel.struts.action.ClientEditAction">
          <forward name="showEdit" path="/form/clientEdit.jsp" />
          <forward
            name="showList"
            path="/viewClients.do?do=showClients"
            redirect="true" />
        </action>
    et comme bean , le meme bean de l'ajout et comme form :

    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
    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
     
    package com.gestionclientmeditel.struts.form;
     
    import java.util.Collection;
     
    import javax.servlet.http.HttpServletRequest;
     
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
     
     
     
    import com.gestionclientmeditel.persistance.ClientBean;
     
    public class ClientEditForm extends ActionForm {
     
     
    	private ClientBean clientBean =new ClientBean();
    	private Collection clients;
     
     
    	public void setClients(Collection c){
    		clients=c;
    	}
    	public Collection getClients(){
    		return clients;
    	}
    	public ClientBean getClientBean(){
    		return clientBean;
    	}
    	public void setClientBean(ClientBean clientBean){
    		this.clientBean=clientBean;
    	}
    	public ActionErrors validate(ActionMapping mapping,HttpServletRequest request){
    		return null;
    	}
    	public void reset(ActionMapping mapping,HttpServletRequest request){
     
    	}
    	public boolean equals(Object arg0){
    		return clientBean.equals(arg0);
    	}
     
    	public String toString(){
    		return clientBean.toString();
    	}
    	public int hashCode(){
    		return clientBean.hashCode();
    	}
     
    	///////////////////////////////////////////////////////////
    	public String getNom() {
    		return clientBean.getNom();
    	}
    	public void setNom(String nom){
    		clientBean.setNom(nom);
    	}
     
    	public int getEtape() {
    		return clientBean.getEtape();
    	}
    	public void setEtape(int etape){
    		clientBean.setEtape(etape);
    	}
    	public String getAdresse() {
    		return clientBean.getAdresse();
    	}
    	public void setAdresse(String adresse){
    		clientBean.setAdresse(adresse);
    	}
     
    	public String getBesoin() {
    		return clientBean.getBesoin();
    	}
    	public void setBesoin(String besoin){
    		clientBean.setBesoin(besoin);
    	}
     
    	public String getContactnom() {
    		return clientBean.getContactnom();
    	}
    	public void setContactnom(String contactnom){
    		clientBean.setContactnom(contactnom);
    	}
     
    	public String getContactnum() {
    		return clientBean.getContactnum();
    	}
    	public void setContactnum(String contactnum){
    		clientBean.setContactnum(contactnum);
    	}
     
    	public String getCapacite() {
    		return clientBean.getCapacite();
    	}
    	/**
             * @param capacite The capacite to set.
             */
    	public void setCapacite(String capacite) {
    		this.clientBean.setCapacite(capacite);
    	}
    	/**
             * @return Returns the dateajout.
             */
    	public String getDateajout() {
    		return clientBean.getDateajout();
    	}
    	/**
             * @param dateajout The dateajout to set.
             */
    	public void setDateajout(String dateajout) {
    		this.clientBean.setDateajout(dateajout);
    	}
    	/**
             * @return Returns the hauteursite.
             */
    	public String getHauteursite() {
    		return clientBean.getHauteursite();
    	}
    	/**
             * @param hauteursite The hauteursite to set.
             */
    	public void setHauteursite(String hauteursite) {
    		this.clientBean.setHauteursite(hauteursite);
    	}
    	/**
             * @return Returns the latitude.
             */
    	public String getLatitude() {
    		return clientBean.getLatitude();
    	}
    	/**
             * @param latitude The latitude to set.
             */
    	public void setLatitude(String latitude) {
    		this.clientBean.setLatitude(latitude);
    	}
    	/**
             * @return Returns the longitude.
             */
    	public String getLongitude() {
    		return clientBean.getLongitude();
    	}
    	/**
             * @param longitude The longitude to set.
             */
    	public void setLongitude(String longitude) {
    		this.clientBean.setLongitude(longitude);
    	}
     
     
     
     
     
    }

    Quand je click sur modifier : dans le navigateur je vois le lien :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    http://localhost:8443/GestionClientMeditel/clientEdit.do?do=editClient&nom=%22%C3%A9
    !!!!!! nom=%22%C3%A9

    donc il y a un conflit de codage de caractere speciaux dans ma page...

    A toi de voir.

    merci encore

  4. #4
    Membre chevronné
    Homme Profil pro
    Directeur technique
    Inscrit en
    Janvier 2007
    Messages
    1 348
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Directeur technique

    Informations forums :
    Inscription : Janvier 2007
    Messages : 1 348
    Points : 1 787
    Points
    1 787
    Par défaut
    Une petite recherche donne http://www.developpez.net/forums/showthread.php?t=10999
    Tu as essayé de gérer l'encoding toi même ?

  5. #5
    Membre à l'essai
    Inscrit en
    Mai 2007
    Messages
    20
    Détails du profil
    Informations forums :
    Inscription : Mai 2007
    Messages : 20
    Points : 12
    Points
    12
    Par défaut
    bonjour,

    Je tiens a vous informer que je suis debutant , et peut etre que certain mot me semble difficile a comprendre.
    pour ne pas se perdre , le string nom qui contient des : é ou des caracteres speciaux doit etre encode avec la methode :

    String java.net.URLEncoder.encode(String s, String enc) throws UnsupportedEncodingException

    puis decoder avec :

    String java.net.URLDecoder.decode(String s, String enc) throws UnsupportedEncodingException

    comment je peux inserer ce code dans ma page JSP :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    <td width="27" class="Style1"><span class="Style5"><html:link action="clientEdit.do?do=editClient"
     
    				paramName="client"
    				paramProperty="nom"
    				paramId="nom"
    				><img src="/GestionClientMeditel/form/images/modifier.jpg " width="27" height="24"></html:link></span></td>
    sachant que client est une collection et nom c'est le string qui m'interesse a envoyer !

    Je suis pressé et j'ai besoin d'une information précise svp

    merci

  6. #6
    Membre à l'essai
    Inscrit en
    Mai 2007
    Messages
    20
    Détails du profil
    Informations forums :
    Inscription : Mai 2007
    Messages : 20
    Points : 12
    Points
    12
    Par défaut
    Bonjour,
    Je veux slm signaler que j'ai pas encore resolu mon probleme.
    Comment je vais deployer les methodes :
    String java.net.URLEncoder.encode(String s, String enc) throws UnsupportedEncodingException

    et

    String java.net.URLDecoder.decode(String s, String enc) throws UnsupportedEncodingException

    Dans mon code!

    si quequ'un peu m'expliquer doucement comment faire, ca sera agréable.

    merci d'avance

Discussions similaires

  1. Réponses: 0
    Dernier message: 06/05/2012, 16h50
  2. comment faire pour que mon parseur XML n'échappe pas les carctères tels que ">" par exemple ?
    Par _LittleFlea_ dans le forum Format d'échange (XML, JSON...)
    Réponses: 4
    Dernier message: 16/10/2009, 16h25
  3. [OpenOffice][Base de données] Les paramètres passés dans la subroutine ne sont pas récupérés par celle-ci
    Par veroby dans le forum OpenOffice & LibreOffice
    Réponses: 6
    Dernier message: 15/03/2009, 20h24
  4. Réponses: 25
    Dernier message: 08/03/2006, 17h03

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