salut a tous.
J'ai un petit soucis avec un formulaire struts.
C'est un formulaire pour envoyer un mail :
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 <html:form action="/envoiEmail.do" name="envoiEmailForm" enctype="multipart/form-data" type="centrale.Form.EnvoiEmailForm" scope="session" method="POST"> <table> <tr> <td>Objet : </td> <td><html:text property="objet" size="40"></html:text> <br> <html:errors property="objetmail"/> </td> </tr> <tr> <td valign="top">Corps :</td> <td><html:textarea property="corps" rows="10" cols="70"></html:textarea> <br> <html:errors property="corpsmail"/> </td> </tr> <tr> <td>Encodage du fichier HTML</td> <td> <html:select property="encodage"> <html:option value="UTF-8">UTF-8</html:option> <html:option value="ISO-8859-1">ISO-8859-1</html:option> <html:option value="windows-1252">CP 1252</html:option> </html:select> </td> </tr> <tr> <td>Corps HTML</td> <td><html:file property="fichierHTML" size="40"/> <br> <html:errors property="corpsmail"/> <html:errors property="htmlmail"/> </td> </tr> <tr> <td>Fichier attaché</td> <td><html:file property="pieceJointe" size="40"/> <br> <html:errors property="taille"/> </td> </tr> <tr> <td> </td> <td> <html:link href="javascript:ajouter('previsualiser')" >Prévisualiser</html:link> <html:link href="javascript:ajouter('tester')" >Tester</html:link> <html:link href="javascript:ajouter('envoyer')" >Envoyer</html:link> </td> </tr> </table> <html:hidden property="actionDispatch" value="default"/> <html:hidden property="btnSubmit"/> <html:hidden styleId="adressetesthidden" property="adresseTest"/> </html:form>
Celui ci doit pouvoir envoyer une piece jointe donc je suis obligé de mettre :
Le probleme c'est que lorsque j'ai des caracteres accentués dans mes champs textes comme "Ségolène" (c'est d'actualité), je me retrouve avec ceci s?gol?ne ..., et ce, des que j'ai fait un set de l'objet dans le formulaire, c'est a dire toute suite apres l'envoi du formulaire...
Code : Sélectionner tout - Visualiser dans une fenêtre à part enctype="multipart/form-data"
J'ai essayé de ne pas mettre l'enctype et de supprimer les champs fichier, et la, le probleme est resolu....
que faut-il faire pour preciser l'encodage des champs textes?
Partager