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 :

struts,ajax et BD


Sujet :

Struts 1 Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre régulier
    Inscrit en
    Août 2008
    Messages
    7
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 7
    Par défaut struts,ajax et BD
    slt,
    je developpe une application en struts je ss encore debutant et jai bcp de problem
    le premier c'est avec authentification jai fais ma page JSP, jai defini mn ActionForm et action (j'ai fai une classe d'authentification avec connection a la base de donnees) mai apres ke j'entre le nom et le mot de pass il me di ke c'est incorrecte
    le deuxieme problem c'est que je sais pas cmt integrer ajax dans mon application:
    j'ai en fait de liste de choix apres avoir fait le premier la 2eme liste dois se remplir avec des donnees relatif au premier choix (en utilisant une connection a la base de donnees) et je sais pas cmt faire
    j'ai essaié de le faire avec DWR et j'ai definit un autre servlet autre ke celui de STRUTS dans la page web.xml mais je sais pas escke c'est correcte
    veuillez m'aider svp et merci bcp les amis

  2. #2
    Membre averti
    Inscrit en
    Août 2008
    Messages
    30
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 30
    Par défaut
    bon pour ajax je ne peut pas t'aider, mais peut etre je peut le faire pour l'authentification.


    donc pe tu m'envoyer les codes du form, jsp et l'action que tu as ecrit.....

  3. #3
    Membre averti
    Inscrit en
    Août 2008
    Messages
    30
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 30
    Par défaut
    j'attend tes codes toujours, sauf si tu n'a plus besoin d'aide et dans ce cas la il faut le mentionné

  4. #4
    Membre régulier
    Inscrit en
    Août 2008
    Messages
    7
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 7
    Par défaut
    merci beaucoup,
    j'ai plus de problem dans l'authentification,mais maintenat j'ai un problem pour afficher des donnees de la base de donnees et il me reste encore le problem de l'ajax qui ne marche pas
    je suis desolé pour le ratard ,j'avais quelques problem de connection c'est pour ca que j'ai po pu te repondre
    merci encore une fois

  5. #5
    Membre chevronné
    Avatar de you.baddi
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2008
    Messages
    185
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Maroc

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mars 2008
    Messages : 185
    Par défaut
    on ce qui concerne ajax tu a raison tu peut utiliser soit ajaxDWR ou tous simplement prototype
    mais il faut toujours donner un exemple de code pour qu'on puis vous aider

  6. #6
    Membre régulier
    Inscrit en
    Août 2008
    Messages
    7
    Détails du profil
    Informations forums :
    Inscription : Août 2008
    Messages : 7
    Par défaut code
    merci
    pour le code le voici
    pour la page 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
    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
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
     
    <%@ 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" %>
     
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Engine Removal</title>
        <script type='text/javascript' src='/ZIRAM/dwr/interface/Removal.js'></script>
        <script type='text/javascript' src='/ZIRAM/dwr/engine.js'></script>
        <script type='text/javascript' src='/ZIRAM/dwr/util.js'></script>
     
    <script type='text/javascript'>
    <!--
     
    function rafraichirListeValeursRegistry() {
    Removal.getListeValeursRegistry($("listevaleursactype").value,remplirListeValeursRegistry);
    }
    function remplirListeValeursRegistry(data) {
    DWRUtil.removeAllOptions("listevaleursvaleursregistry");
    DWRUtil.addOptions("listevaleursregistry", data);
    DWRUtil._selectListItem($("listevaleursregistry"),$("listevaleursregistry").options[0].value);
    }
     
    function rafraichirListeValeursPos() {
    Removal.getListeValeursPos($("listevaleursregistry").value,remplirListeValeursPos);
    }
    function remplirListeValeursPos(data) {
    DWRUtil.removeAllOptions("listevaleurspos");
    DWRUtil.addOptions("listevaleurspos", data);
    DWRUtil._selectListItem($("listevaleurspos"),$("listevaleurspos").options[0].value);
    }
     
    function majEngineRemoval() {
    Removal.getEngineSN($("listevaleursregistry").value,$("listevaleurspos").value,afficherEngineSN);
    Removal.getEngineTR(afficherEngineTR, $("Enginesn").value);
    Removal.getEngineAC(afficherEngineAC, $("Enginesn").value);
    Removal.getEnginePos(afficherEnginePos, $("Enginesn").value);
    Removal.getEngineTAI(afficherEngineTAI, $("Enginesn").value);
    Removal.getEngineCAI(afficherEngineCAI, $("Enginesn").value);
    Removal.getEngineTSN(afficherEngineTSN, $("Enginesn").value);
    Removal.getEngineCSN(afficherEngineCSN, $("Enginesn").value);
    }
     
    function afficherEngineSN(data) {
    DWRUtil.setValue("EngineSN",data);
    }
    function afficherEngineTR(data) {
    DWRUtil.setValue("TR",data);
    }
    function afficherEngineAC(data) {
    DWRUtil.setValue("AC",data);
    }
    function afficherEnginePos(data) {
    DWRUtil.setValue("Position",data);
    }
    function afficherEngineTAI(data) {
    DWRUtil.setValue("TAI",data);
    }
    function afficherEngineCAI(data) {
    DWRUtil.setValue("CAI",data);
    }
    function afficherEngineTSN(data) {
    DWRUtil.setValue("AC",data);
    }
    function afficherEngineCSN(data) {
    DWRUtil.setValue("Position",data);
    }    
    function init() {
    DWRUtil.useLoadingMessage();
     
    rafraichirListeValeursRegistry();
    rafraichirListeValeursPos();
    }
     
    -->
    </script>
     
    <style type="text/css">
    <!--
    body {
        margin-left: 100px;
        margin-top: 30px;
        margin-right: 100px;
    }
    .Style1 {color: #007FFF}
    .Style2 {
        font-size: 24px;
        font-style: italic;
        font-weight: bold;
        color: #000066;
    }
    .Style4 {font-size: 16px}
    .Style5 {color: #000066}
    .Style7 {
        font-size: 16px;
        font-weight: bold;
        font-style: italic;
    }
    -->
    </style></head>
     
    <body onload="init();">
     
    <table width="906" height="824" border="1" align="center">
      <tr>
        <td width="230" height="128"><div align="center"><img src="Sans titre-2.png" width="230" height="170" /></div></td>
        <td width="410"><p align="center"><img src="Sans titre2.png" width="410" height="170" /></p>    </td>
        <td width="244"><img src="Sans titre1.png" width="244" height="170" /></td>
      </tr>
      <tr>
        <td height="617" valign="top" bgcolor="#FFFCEB">
        <div align="center" class="Style1"><img src="Sans titre.png" width="230" height="120" />
     
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="230" height="300">
          <param name="movie" value="xmlmenu.swf" />
          <param name="quality" value="high" />
          <embed src="xmlmenu.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="540" height="300"></embed>
          </object>
        <img src="Sans titre11.png" width="230" height="172" />    </div></td>
        <td height="617" colspan="2" align="center" valign="top"><div align="center" class="Style2">
     
          <p>Engine Removal </p>
          <html:form action="remove">
          <table width="648" border="0">
            <tr>
              <th width="216" scope="col"><div align="left"><span class="Style4">Aircraft Type:</span>
                  <select id="listevaleursactype" name="listevaleursactype" size="1" onchange="rafraichirListeValeursRegistry();">
     
                                 <logic:present name="actypeok">
                                 <logic:iterate id="remform" name="actypeok">
                           <option value="<bean:write name="remform" property="actype"/>">
                                     <bean:write name="remform" property="actype"/> 
                             </option>
     
                                  </logic:iterate>
                                  </logic:present>   
     
                   </select>
              </div></th>
              <th width="216" scope="col"><div align="left"><span class="Style4">Registry:</span>
                  <select id="listevaleursregistry" name="listevaleursregistry" size="1" onchange="rafraichirListeValeursPos();">
                    </select>
              </div></th>
              <th width="216" scope="col"><div align="left"><span class="Style4">Position:</span>
                  <select id="listevaleurspos" name="listevaleurspos" size="1" >
                    </select>
              </div></th>
            </tr>
          </table>
     
          <p><a href="javascript:majEngineRemoval();" ><img src="bouton1.png" width="110" height="20"/></a></p>
          <blockquote>
            <blockquote>
              <p align="left"></p>
            </blockquote>
          </blockquote>
          </div>
          <table width="653" border="0">
            <tr class="Style7">
            <td width="213" height="50"><div align="center" class="Style5">
              <div align="center">
                <p><span class="Style7">Engine SN</span></p>
                <p><em>
                  <input name="Enginesn" type="text" id="Enginesn" size="20" readonly="true" />
     
                </em></p>
              </div>
            </div></td>
              <td width="213" height="50"><div align="center" class="Style5">
                <div align="center">
                  <p><em>Trust R.</em></p>
                  <p><em>
                    <input name="TR" type="text" id="TR" size="20" readonly="true" />
                    </em></p>
                </div>
              </div></td>
              <td width="213" height="50"><div align="center" class="Style5">
                <div align="center">
                  <p><em>Aircraft</em></p>
                  <p><em>
                    <input name="AC" type="text" id="AC" size="20" readonly="true" />
                    </em></p>
                </div>
              </div></td>
            </tr>
            <tr>
              <td height="50"><div align="center">
                <p class="Style5">&nbsp;</p>
                <p class="Style5"><span class="Style7">Position</span></p>
                <p class="Style5"><em><em>
                  <input name="Position" type="text" id="Position" size="20" />
                  </em>
     
                  </em></p>
              </div></td>
              <td height="50"><div align="center">
                <p class="Style5">&nbsp;</p>
                <p class="Style5"><span class="Style7">TAI</span></p>
                <p class="Style5"><em>
                  <input name="TAI" type="text" id="TAI" size="20" readonly="true" />
     
                  </em></p>
              </div></td>
              <td height="50"><div align="center">
                <p class="Style5">&nbsp;</p>
                <p class="Style5"><span class="Style7">CAI</span></p>
                <p class="Style5"><em><em></em>
                  <input name="CAI" type="text" id="CAI" size="20" readonly="true" />
     
                  </em></p>
              </div></td>
            </tr>
            <tr>
              <td height="50"><div align="center">
                <p class="Style5">&nbsp;</p>
                <p class="Style5"><span class="Style7">TSN</span></p>
                <p class="Style5"><em>
                  <input name="TSN" type="text" id="TSN" size="20" readonly="true" />
     
                  </em></p>
              </div></td>
              <td height="50"><div align="center">
                <p class="Style5">&nbsp;</p>
                <p class="Style5"><span class="Style7">CSN</span></p>
                <p class="Style5"><em>
                  <input name="CSN" type="text" id="CSN" size="20" readonly="true" />
                </em></p>
              </div></td>
              <td height="50"><div align="center">
                <p class="Style5">&nbsp;</p>
                <p class="Style5"><span class="Style7">DATE</span><em><em></em></em></p>
                <p class="Style5"><em>
                  <input name="DATE" type="text" id="DATE" size="20" />
     
                  </em></p>
              </div></td>
            </tr>
            <tr class="Style7">
              <td height="50"><div align="center">
                <p class="Style5">&nbsp;</p>
                <p class="Style5">Rem Date</p>
                <p class="Style5"><em>
                  <input name="Remdate" type="text" id="Remdate" size="20" />
     
                      </em></p>
              </div></td>
              <td height="50"><div align="center">
                <p class="Style5">&nbsp;</p>
                <p class="Style5">Rem Reason</p>
                <p class="Style5"><em>
                  <input name="Remreason" type="text" id="Remreason" size="20" />
     
                  </em></p>
              </div></td>
              <td height="50"><div align="center">
                <p class="Style5">&nbsp;</p>
                <p class="Style5"><span class="Style7">Rem Class</span></p>
                <p class="Style5"><em>
                  <input name="DATE" type="text" id="DATE" size="20" />
     
                  </em></p>
              </div></td>
            </tr>
            <tr class="Style7">
              <td height="119"><div align="center">
                <p class="Style5">&nbsp;</p>
                <p class="Style5">Total Cycle </p>
                <p class="Style5"><em>
                  <input name="TC" type="text" id="TC" size="20" />
                </em></p>
              </div></td>
              <td height="119"><div align="center">
                <p class="Style5">&nbsp;</p>
                <p class="Style5">Workscope Num </p>
                <p class="Style5"><em>
                  <input name="workscope" type="text" id="worscope" size="20" />
                </em></p>
              </div></td>
              <td height="119"> <div align="center">
                <p class="Style5">&nbsp;</p>
                <p class="Style5">Total Time </p>
                <p class="Style5"><em>
                  <input name="TT" type="text" id="TT" size="20" />
                </em></p>
              </div>            
                </td>
            </tr>
          </table>
          <p> <html:submit value="Valider" />
      </html:form>
          </p></td>
      </tr>
      <tr>
        <td height="23" colspan="3"><div align="right">
        <%= new java.util.Date().toString() %></div></td>
      </tr>
    </table>
    </body>
    </html>
    Class Java ou j'ai mis le traitement:
    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
    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
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
     
    package com.myapp.struts;
     
    import java.sql.*;
    import java.util.*;
     
    public class Removal {
     
     
    public ArrayList getListeValeursRegistry(String actype)
    {
         java.sql.Statement etat;
            ResultSet rs=null;
            String sql;
            Connection conn;
                    ArrayList regList=new ArrayList();
     
            sql="select REGSITRY from aircraft where AC_TYPE='"+actype+"'";
     
     
            try{        
               conn=ConnectionManager.getConnection();
                etat=conn.createStatement();
                rs=etat.executeQuery(sql);
     
                while (rs.next()) {
                    regList.add(rs.getString("REGSITRY"));
                }
                rs.close();
     
            } catch ( SQLException e ) {
                System.err.println("SQL Exception occured while accessing the table" );
                e.printStackTrace();
                return null;
     
            } catch ( Exception e ) {
                e.printStackTrace();
                return null;
            }
     
            return regList;
     
    }
     
    public ArrayList getListeValeursPos(String acregistry)
    {
        java.sql.Statement etat;
            ResultSet rs=null;
            String sql;
            Connection conn;
                    ArrayList posList=new ArrayList();
     
            sql="select POSITION from engine where REGSITRY ='"+acregistry+"'";
     
     
            try{        
               conn=ConnectionManager.getConnection();
                etat=conn.createStatement();
                rs=etat.executeQuery(sql);
     
                while (rs.next()) {
                    posList.add(rs.getString("POSITION"));
                }
                rs.close();
     
            } catch ( SQLException e ) {
                System.err.println("SQL Exception occured while accessing the table" );
                e.printStackTrace();
                return null;
     
            } catch ( Exception e ) {
                e.printStackTrace();
                return null;
            }
     
            return posList;
        }
     
     
    public int getEngineSN(String acregistry,int pos)
    {
        int resultat = 0;
        Statement sta=null;
        ResultSet rs=null;
     
        String sqlposition ="select SN from engine where REGSITRY ='"+acregistry+"' and POSITION="+pos+"";
        try{
            Connection con=ConnectionManager.getConnection();
            sta=con.createStatement();
            rs=sta.executeQuery(sqlposition);
     
                resultat=(rs.getInt("SN"));
     
        }catch(Exception ex){
            System.out.println(ex);
        }
        System.out.println(sqlposition);
    return resultat;    
    }
    public int getEngineTR(String enginesn)
    {
        int resultat = 0;
        int sn=Integer.parseInt(enginesn);
        Statement sta=null;
        ResultSet rs=null;
     
        String sqlposition ="select TH_R_VALUE from engine where SN ='"+sn+"'";
        try{
            Connection con=ConnectionManager.getConnection();
            sta=con.createStatement();
            rs=sta.executeQuery(sqlposition);
     
                resultat=(rs.getInt("TH_R_VALUE"));
     
        }catch(Exception ex){
            System.out.println(ex);
        }
        System.out.println(sqlposition);
    return resultat;    
    }
    public String getEngineAC(String enginesn)
    {
        String resultat=null ;
        int sn=Integer.parseInt(enginesn);
        Statement sta=null;
        ResultSet rs=null;
     
        String sqlposition ="select REGSITRY from engine where SN ='"+sn+"'";
        try{
            Connection con=ConnectionManager.getConnection();
            sta=con.createStatement();
            rs=sta.executeQuery(sqlposition);
     
                resultat=(rs.getString("REGSITRY"));
     
        }catch(Exception ex){
            System.out.println(ex);
        }
        System.out.println(sqlposition);
    return resultat;    
    }
    public int getEnginePos(String enginesn)
    {
         int resultat = 0;
        int sn=Integer.parseInt(enginesn);
        Statement sta=null;
        ResultSet rs=null;
     
        String sqlposition ="select POSITION from engine where SN ='"+sn+"'";
        try{
            Connection con=ConnectionManager.getConnection();
            sta=con.createStatement();
            rs=sta.executeQuery(sqlposition);
     
                resultat=(rs.getInt("POSITION"));
     
        }catch(Exception ex){
            System.out.println(ex);
        }
        System.out.println(sqlposition);
    return resultat;    
    }
    public int getEngineTAI(String enginesn)
    {
         int resultat = 0;
        int sn=Integer.parseInt(enginesn);
        Statement sta=null;
        ResultSet rs=null;
     
        String sqlposition ="select TAI from engine where SN ='"+sn+"'";
        try{
            Connection con=ConnectionManager.getConnection();
            sta=con.createStatement();
            rs=sta.executeQuery(sqlposition);
     
                resultat=(rs.getInt("TAI"));
     
        }catch(Exception ex){
            System.out.println(ex);
        }
        System.out.println(sqlposition);
    return resultat;    
    }
    public int getEngineCAI(String enginesn)
    {
         int resultat = 0;
        int sn=Integer.parseInt(enginesn);
        Statement sta=null;
        ResultSet rs=null;
     
        String sqlposition ="select CAI from engine where SN ='"+sn+"'";
        try{
            Connection con=ConnectionManager.getConnection();
            sta=con.createStatement();
            rs=sta.executeQuery(sqlposition);
     
                resultat=(rs.getInt("CAI"));
     
        }catch(Exception ex){
            System.out.println(ex);
        }
        System.out.println(sqlposition);
    return resultat;    
    }
    public int getEngineTSN(String enginesn)
    {
         int resultat = 0;
        int sn=Integer.parseInt(enginesn);
        Statement sta=null;
        ResultSet rs=null;
     
        String sqlposition ="select ENGINE_TSN from engine where SN ='"+sn+"'";
        try{
            Connection con=ConnectionManager.getConnection();
            sta=con.createStatement();
            rs=sta.executeQuery(sqlposition);
     
                resultat=(rs.getInt("ENGINE_TSN"));
     
        }catch(Exception ex){
            System.out.println(ex);
        }
        System.out.println(sqlposition);
    return resultat;    
    }
    public int getEngineCSN(String enginesn)
    {
         int resultat = 0;
        int sn=Integer.parseInt(enginesn);
        Statement sta=null;
        ResultSet rs=null;
     
        String sqlposition ="select ENGINE_CSN from engine where SN ='"+sn+"'";
        try{
            Connection con=ConnectionManager.getConnection();
            sta=con.createStatement();
            rs=sta.executeQuery(sqlposition);
     
                resultat=(rs.getInt("ENGINE_CSN"));
     
        }catch(Exception ex){
            System.out.println(ex);
        }
        System.out.println(sqlposition);
    return resultat;    
    }
     
    public java.util.Date getRemDate(String enginesn)
    {
         java.util.Date resultat = null;
        int sn=Integer.parseInt(enginesn);
        Statement sta=null;
        ResultSet rs=null;
     
        String sqlposition ="select DATE_INST from engine where SN ='"+sn+"'";
        try{
            Connection con=ConnectionManager.getConnection();
            sta=con.createStatement();
            rs=sta.executeQuery(sqlposition);
     
                resultat=(rs.getDate("DATE_INST"));
     
        }catch(Exception ex){
            System.out.println(ex);
        }
        System.out.println(sqlposition);
    return resultat;    
    }
    }
    fichier dwr.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
     
    <!DOCTYPE dwr PUBLIC
    "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
    "http://www.getahead.ltd.uk/dwr/dwr10.dtd">
    <dwr>
    <allow>
        <create creator="new" javascript="Llp">
    <param name="class" value="com.myapp.struts.Llp"/>
    </create>
    <create creator="new" javascript="Removal">
    <param name="class" value="com.myapp.struts.Removal"/>
    </create>
    <create creator="new" javascript="Status">
    <param name="class" value="com.myapp.struts.Status"/>
    </create>
    <create creator="new" javascript="Install">
    <param name="class" value="com.myapp.struts.Install"/>
    </create>
    <convert converter="bean" match="com.myapp.struts.RemoveForm"/>
    </allow>
    </dwr>
    merci bcp

Discussions similaires

  1. [STRUTS][AJAX]Quel framework AJAX avec Struts
    Par woodwai dans le forum Struts 1
    Réponses: 24
    Dernier message: 12/03/2009, 16h19
  2. Struts/Ajax: Submit asynchrone
    Par MedMek dans le forum Struts 1
    Réponses: 1
    Dernier message: 03/04/2008, 16h36
  3. Struts + ajax
    Par clement42 dans le forum Struts 1
    Réponses: 1
    Dernier message: 04/04/2007, 10h17
  4. [débutant] Struts + ajax
    Par chennuo dans le forum Struts 1
    Réponses: 11
    Dernier message: 30/10/2006, 14h43
  5. [Struts][Ajax]Rafraichir une partie d'une JSP
    Par jsl1 dans le forum Servlets/JSP
    Réponses: 6
    Dernier message: 22/02/2006, 14h09

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