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 :

2 forms, 1 action


Sujet :

Struts 1 Java

  1. #1
    Membre éclairé
    Avatar de CPI_en_mousse
    Homme Profil pro
    Développeur Java
    Inscrit en
    Avril 2006
    Messages
    332
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2006
    Messages : 332
    Par défaut 2 forms, 1 action
    Bonjour a tous le code suivant me pose probleme:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    <html:form action="mail" styleId="mail">                                    
                        <tr>
                            <td>
                                <html:select title="Mails" name="mails" property="id">
                                    <html:options collection="mails" property="id" labelProperty="title"/>
                                </html:select>  
                            </td>
                        </tr>
                        <tr>                        
                            <td><html:submit>Send</html:submit></td>
                        </tr>
                   </html:form>
    J'obtiens l'erreur suivante :

    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
    javax.servlet.jsp.JspException: No getter method available for property id for bean under name mails
        org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:266)
        org.apache.struts.taglib.html.SelectTag.doStartTag(SelectTag.java:200)
        org.apache.jsp.applicant.displayApplicant_jsp._jspx_meth_html_select_0(displayApplicant_jsp.java:930)
        org.apache.jsp.applicant.displayApplicant_jsp._jspx_meth_html_form_1(displayApplicant_jsp.java:894)
        org.apache.jsp.applicant.displayApplicant_jsp._jspx_meth_logic_present_0(displayApplicant_jsp.java:858)
        org.apache.jsp.applicant.displayApplicant_jsp._jspService(displayApplicant_jsp.java:284)
        org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
        org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
        org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
        org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
        org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
        org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
        org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
        org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
        org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
    alors que tous semble correcte, dans l'action form bean :
    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
    /*
     * MailForm.java
     *
     * Created on 10 juillet 2007, 8:45
     */
     
    package be.qspin.qats.struts.form;
     
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.ActionMessage;
     
    /**
     *
     * @author Florian Guillemotte
     * @author fguillemotte@gmail.com
     * @version
     */
     
    public class MailForm extends org.apache.struts.action.ActionForm {
     
     
     
        /**
         *
         */
        public MailForm() {
            super();
            // TODO Auto-generated constructor stub
        }
     
        public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
            ActionErrors errors = new ActionErrors();
            if ( getId().length() <= 0) {
                errors.add("name", new ActionMessage("error.name.required"));
                // TODO: add 'error.name.required' key to your resources
            }
            return errors;
        }
     
        /**
         * Holds value of property id.
         */
        private String id;
     
        /**
         * Getter for property id.
         * @return Value of property id.
         */
        public String getId() {
            return this.id;
        }
     
        /**
         * Setter for property id.
         * @param id New value of property id.
         */
        public void setId(String id) {
            this.id = id;
        }
    }
    et de meme dans struts config :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
            <action input="/mail" 
                    name="MailForm" 
                    path="/mail" 
                    scope="session" 
                    type="be.qspin.qats.struts.action.MailAction">
                <forward name="success" path="/management/mail.jsp"/>            
            </action>
    Avez vous une petite idée..;

    Merci beaucoup

  2. #2
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    La propriété id spécifiée dans le tag html:select étant une propriété du form-bean MailForm, il faut enlever l'attribut name="mails" dans le tag html:select :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    <html:select title="Mails" property="id">
         <html:options collection="mails" property="id" labelProperty="title"/>
    </html:select>

  3. #3
    Membre éclairé
    Avatar de CPI_en_mousse
    Homme Profil pro
    Développeur Java
    Inscrit en
    Avril 2006
    Messages
    332
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2006
    Messages : 332
    Par défaut
    le probleme est le meme.

    j'ai aussi ce form d'une autre page qui utilise la meme 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
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
     
            <script type="text/javascript">
                <!--
     
    function editMail(id){
        document.forms['mail'].elements['id'].value = id;
        document.forms['mail'].submit();
    }
    //-->        
            </script>
     
                          <html:form action="mail" styleId="mail">
                                    <html:hidden property="id" value="0"/>
                                    <logic:iterate name="mails" id="mails" scope="session">
                                        <tr>
                                            <td><bean:write name="mails" property="title"/></td>
                                            <td><html:submit onclick="javascript:editMail('${mails.id}')">Edit</html:submit></td>
                                        </tr>
                                    </logic:iterate>
                                    <tr>
                                        <td colspan="2">
                                            <html:submit onclick="javascript:editMail('0')">New mail</html:submit>
                                        </td>
                                    </tr>
                                </html:form>
    mais pour celui ci, je n'ai aucun probleme. le probleme que je rencontre est peut etre lié aussi a ce form.

  4. #4
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Après la modif, quel message d'erreur obtiens-tu exactement ?

  5. #5
    Membre éclairé
    Avatar de CPI_en_mousse
    Homme Profil pro
    Développeur Java
    Inscrit en
    Avril 2006
    Messages
    332
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2006
    Messages : 332
    Par défaut
    tous chaud le message d'erreur

    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
    10:39:33,499 ERROR [jsp]:704 - "Servlet.service()" pour la servlet jsp a lancé une exception
    javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN
            at org.apache.struts.taglib.html.BaseHandlerTag.lookupProperty(BaseHandlerTag.java:945)
            at org.apache.struts.taglib.html.RadioTag.currentValue(RadioTag.java:198)
            at org.apache.struts.taglib.html.RadioTag.doStartTag(RadioTag.java:166)
            at org.apache.jsp.applicant.displayApplicant_jsp._jspx_meth_html_radio_0(displayApplicant_jsp.java:1650)
            at org.apache.jsp.applicant.displayApplicant_jsp._jspService(displayApplicant_jsp.java:367)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
            at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
            at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
            at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
            at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
            at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
            at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
            at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
            at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
            at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:595)
    10:39:33,544 ERROR [action]:253 - "Servlet.service()" pour la servlet action a généré une exception
    javax.servlet.jsp.JspException: Cannot find bean under name org.apache.struts.taglib.html.BEAN
            at org.apache.struts.taglib.html.BaseHandlerTag.lookupProperty(BaseHandlerTag.java:945)
            at org.apache.struts.taglib.html.RadioTag.currentValue(RadioTag.java:198)
            at org.apache.struts.taglib.html.RadioTag.doStartTag(RadioTag.java:166)
            at org.apache.jsp.applicant.displayApplicant_jsp._jspx_meth_html_radio_0(displayApplicant_jsp.java:1650)
            at org.apache.jsp.applicant.displayApplicant_jsp._jspService(displayApplicant_jsp.java:367)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
            at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
            at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
            at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
            at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
            at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
            at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
            at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
            at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
            at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Thread.java:595)

  6. #6
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Dans la page jsp, tu dois avoir autre chose que ce code-là non ?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    <html:form action="mail" styleId="mail">                                    
                        <tr>
                            <td>
                                <html:select title="Mails" property="id">
                                    <html:options collection="mails" property="id" labelProperty="title"/>
                                </html:select>  
                            </td>
                        </tr>
                        <tr>                        
                            <td><html:submit>Send</html:submit></td>
                        </tr>
                   </html:form>
    Si c'est bien le cas, peux-tu donner tout le code de la page jsp ?

  7. #7
    Membre éclairé
    Avatar de CPI_en_mousse
    Homme Profil pro
    Développeur Java
    Inscrit en
    Avril 2006
    Messages
    332
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2006
    Messages : 332
    Par défaut
    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
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    <%@ 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://displaytag.sf.net" prefix="display"%>
    <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
     
    <%@ page import="java.util.Date" %>
    <%@ page import="java.text.SimpleDateFormat" %>
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <% SimpleDateFormat dateFormatter = new SimpleDateFormat("dd"); %>
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <logic:notPresent scope="session" name="user">
        <logic:forward name="logon"/>
    </logic:notPresent>
    <logic:notPresent scope="session" name="applicant">
        <logic:forward name="search"/>
    </logic:notPresent>
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title><bean:message key="application.title"/></title>
        <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/site.css"/>  
        <script type="text/javascript">
                <!--
    window.onload=show;
    function show(id) {
    var d = document.getElementById(id);
        for (var i = 1; i<=10; i++) {
            if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
        }
    if (d) {d.style.display='block';}
    }
     
    function editForm(){
        document.forms['createApplicant'].disabled=false;
    }
     
    function selectField2(jobTitle){
        document.forms['createApplicant'].elements[jobTitle].focus();
        if (jobTitle == 'jobTitle'){
            document.forms['createApplicant'].elements['newJobTitle'].disabled = true;
            document.forms['createApplicant'].elements['jobTitle'].disabled = false;
            document.forms['createApplicant'].elements['jobTitle'].focus();
            }
        else{
            document.forms['createApplicant'].elements['jobTitle'].disabled = true;
            document.forms['createApplicant'].elements['newJobTitle'].disabled = false;
            document.forms['createApplicant'].elements['newJobTitle'].focus();
            }
    }
     
    function putValue(from, to){
        document.forms['createApplicant'].elements['to'].value = to;
        document.forms['createApplicant'].elements['from'].value = from;
    }
     
     
    //-->        
        </script>
    </head>
    <body>       
    <div id="titre">
        <bean:message key="application.title"/>
    </div>
    <div id="soustitre">
        <bean:write scope="session" name="user" property="login"/>
    </div>
    <div id="topRow">
        <div id="menu">                
            <dl>
                <dt onmouseover="javascript:show();"><a href="/QATS/main.jsp" title="Go to Home page">Home</a></dt>
            </dl>                
            <dl>            
                <dt onmouseover="javascript:show('smenu1');">TODO List</dt>
                <dd id="smenu1">
                    <ul>
                        <li><a href="/QATS/todoList.jsp" title="See Todo list of all users">All Todo</a></li>                            
                        <li><a href="/QATS/applicant/applicant.jsp" title="Create a new applicant file">New Applicant</a></li>
                        <li><a href="/QATS/applicant/searchApplicant.jsp" title="Search an applicant">Search</a></li>
                        <li><a href="#" title="All applicant which are in reserve">In reserve</a></li>
                    </ul>
     
                </dd>
            </dl>                       
            <dl>    
                <dt onmouseover="javascript:show('smenu2');">Applicant</dt>
                <dd id="smenu2">
                    <ul>
                        <li><a href="/QATS/applicant/displayApplicant.jsp" title="Display personal information about the current applicant">Personal Details</a></li>
                        <li><a href="/QATS/applicant/xpApplicant.jsp" title="Display information on education and experience about the current applicant">Professional Details</a></li>
                        <li><a href="/QATS/applicant/history.jsp" title="Display the historic about the current applicant">Historic</a></li>                            
                        <li><a href="/QATS/applicant/commentApplicant.jsp" title="Display all comments about the current applicant">Comment</a></li>
                        <li><a href="#" title="List all documents which concern the current applicant">Document</a></li>                            
                    </ul>
                </dd>
            </dl>
            <dl>    
                <dt onmouseover="javascript:show('smenu3');">Tools</dt>
                <dd id="smenu3">                                
                    <ul>
                        <li><a href="#">Statistics</a></li>
                        <li><a href="/QATS/about.jsp">About</a></li>
                        <li><a href="/QATS/releaseNotes.jsp">Release Notes</a></li>
                    </ul>
                </dd>
            </dl>               
            <dl>
                <dt onmouseover="javascript:show();"><html:link action="/logout" linkName="Log me out">Logout</html:link></dt>
            </dl>                 
        </div>
    </div>
     
    <div id="bodyRightColumn">               
    </div>
     
    <div id="bodyLeftColumn">  
    <html:form action="createApplicant" styleId="createApplicant">
    <fieldset>
    <legend>Display An applicant</legend>
    <logic:present name="mails" scope="session">
        <div id="beauxTableaux">
            <table>
                <thead>
                    <tr>
                        <th colspan="2">
                            Title
                        </th>                                
                    </tr>
                </thead>
                <tbody>               
                    <html:form action="mail" styleId="mail">                                    
                        <tr>
                            <td>
                                <html:select title="Mails" property="id">
                                    <html:options collection="mails" property="id" labelProperty="title"/>
                                </html:select>
                            </td>
                        </tr>
                        <tr>                        
                            <td><html:submit>Send</html:submit></td>
                        </tr>
                    </html:form>
                </tbody>
            </table>
        </div>
    </logic:present>
    <table>
        <tr>
            <td>
                <bean:message key="applicant.interest"/>: 
            </td>
            <td>
                <html:select property="interest" title="interest" value="${applicant.interest}">
                    <html:option value="0 - No"/>
                    <html:option value="1 - Low"/>
                    <html:option value="2 - Medium"/>
                    <html:option value="3 - High"/> 
                    <html:option value="4 - Successful Interview"/>
                    <html:option value="5 - Proposal"/>
                    <html:option value="6 - Hired"/> 
                </html:select>
     
            </td>
        </tr>
        <tr>
            <td>
                <bean:message key="applicant.source"/>: 
            </td>
            <td>
                <html:text property="source" title="Source" value="${applicant.source}"/>                            
            </td>
        </tr>
        <tr>
            <td>
                <bean:message key="applicant.language"/>: 
            </td>
            <td>
                <html:select property="language" title="Language" value="${applicant.langCom}">
                    <html:option value="0 - English"/>
                    <html:option value="1 - French"/>
                    <html:option value="2 - Dutch"/>                                 
                </html:select>
     
            </td>
        </tr>
    </table>
    <fieldset>
        <legend>Personal data</legend>
        <div id="error">
            <logic:messagesPresent message="false" property="name">
                <html:errors property="name"/>
            </logic:messagesPresent>
            <logic:messagesPresent message="false" property="firstname">
                <html:errors property="firstname"/>
            </logic:messagesPresent>
            <logic:messagesPresent message="false" property="firstname">
                <html:errors property="firstname"/>
            </logic:messagesPresent>
            <logic:messagesPresent message="false" property="email">
                <html:errors property="email"/>
            </logic:messagesPresent>
        </div>
        <table>
            <tr>
                <td><bean:message key="applicant.gender"/> :</td>
                <td></td>
                <td>
                    <html:select property="gender" value="${applicant.gender}" title="Gender" tabindex="1" >
                        <html:option value="Mister" />
                        <html:option value="Miss"/>
                        <html:option value="Madam"/>
                    </html:select>
                </td>
            </tr>
            <tr>
                <td><bean:message key="applicant.lastname" /> : </td>
                <td></td>
                <td><html:text property="lastname" title="lastname" value="${applicant.lastname}" tabindex="2"></html:text></td>
            </tr>
            <tr>
                <td><bean:message key="applicant.firstname"/> : </td>
                <td></td>
                <td><html:text  property="firstname" title="firstname" value="${applicant.firstname}" tabindex="3"></html:text></td>                         
            </tr>
            <tr>
                <td><bean:message key="applicant.JobTitle"/> : </td>
                <td>
                    <html:radio property="selectJobTitle" value="list" onclick="javascript:selectField2('jobTitle')"/>
                </td>
                <td>   
                    <html:select title="QSpin Job Title" property="jobTitle" tabindex="10" value="${applicant.jobTitle.title}" >
                        <html:options collection="allJobTitle" property="id"  labelProperty="title"/>
                    </html:select>  
                </td>
            </tr>
            <tr>
                <td>                                
                </td>
                <td>
                    <html:radio property="selectJobTitle" value="new" onclick="javascript:selectField2('newJobTitle')"/>
                </td>
                <td>
                    <html:text value="or new" property="newJobTitle" disabled="true" tabindex="12" title="new job Title"/>
                </td>
            </tr>
            <tr>
                <td><bean:message key="applicant.birthday"/> <bean:message key="applicant.birthday.format"/>: </td>
                <td></td>
                <td>
                    <logic:notEmpty name="applicant" property="birthday" scope="session">
                        <html:text property="day" title="day" maxlength="2" size="2" tabindex="20" />
                        <html:text property="month" title="month" maxlength="2" size="2" tabindex="30"/>
                        <html:text property="year" title="year" maxlength="4" size="4" tabindex="40" />
                    </logic:notEmpty>
                </td>
            </tr>
            <tr>
                <td><bean:message key="applicant.nationality"/> : </td>
                <td></td>
                <td><html:text property="nationality" value="${applicant.nationality}" tabindex="70" /></td>
            </tr>
            <tr>
                <td><bean:message key="applicant.address" /> : </td>
                <td></td>
                <td><html:text property="address" value="${applicant.address}" tabindex="80"></html:text></td>
            </tr>
            <tr>
                <td><bean:message key="applicant.pc" /> : </td>
                <td></td>
                <td><html:text property="pc" tabindex="90" value="${applicant.PC}" ></html:text></td>
            </tr>
            <tr>
                <td><bean:message key="applicant.city"/> : </td>
                <td></td>
                <td><html:text property="city" tabindex="100" value="${applicant.city}"></html:text></td>
            </tr>
            <tr>
                <td><bean:message key="applicant.country"/> : </td>
                <td></td>
                <td><html:text property="country" tabindex="110" value="${applicant.country}" ></html:text></td><br>
            </tr>
            <tr>
                <td><bean:message key="applicant.phone"/> : </td>
                <td></td>
                <td><html:text property="phone" tabindex="120" value="${applicant.phone}" ></html:text></td><br>
            </tr>
            <tr>
                <td><bean:message key="applicant.gsm"/> : </td>
                <td></td>
                <td><html:text property="gsm" tabindex="130" value="${applicant.gsm}"></html:text></td><br>
            </tr>
            <tr>
            <td><bean:message key="applicant.mail"/> : </td>
            <td></td>
            <td><html:text property="mail" tabindex="140" value="${applicant.email}"></html:text></td><br>
        </table>
    </fieldset>
    <html:hidden property="id" value="${applicant.id}"/>   
    <html:hidden property="to"/>  
    <html:hidden property="from"/>
    <html:submit onclick="javascript:putValue('', '')" property="record" value="Record"/>
    <logic:present scope="session" name="listButton">        
    <div id="beauxTableaux"> 
    <table>
    <thead>
    <tr>
        <th>
            Current State:
        </th>
        <th>
            Next State:
        </th>
        <th>Action</td>
    </tr>  
    </thead>
    <tbody>     
        <logic:iterate id="listButton" name="listButton" scope="session">            
            <tr>
                <td>
                    <bean:write name="listButton" property="from"/>
                </td>
                <td>
                    <bean:write name="listButton" property="to"/>  
                </td>
                <td>
                    <logic:notEmpty name="listButton" property="button">    
                        <html:submit  onclick="javascript:putValue('${listButton.from}', '${listButton.to}')" property="${listButton.button.id}"><bean:message key="${listButton.button.key}" name="listButton" property="to"/></html:submit>
                    </logic:notEmpty>
                    <%--logic:empty name="listButton" property="button">
                <html:cancel tabindex="200"><bean:message key="button.cancel" /></html:cancel>
            </logic:empty--%> 
                </td>   
            </tr>                          
        </logic:iterate>     
    </tbody>  
    </table>  
    </div>
    </logic:present>                       
    </html:form>
    </fieldset>
    </div>
    <div id="footer">
        <bean:message key="application.footer" /><br><bean:message key="application.version" />
    </div> 
    </body>
    </html>

  8. #8
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Ton message d'erreur est sans aucun doute lié au fait que tu as un html:form imbriqué dans un autre html:form.

  9. #9
    Membre éclairé
    Avatar de CPI_en_mousse
    Homme Profil pro
    Développeur Java
    Inscrit en
    Avril 2006
    Messages
    332
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2006
    Messages : 332
    Par défaut
    Suis vraiment deg, tous ca pour seulement ca a chaque fois c'est pareil, je passe a cote

    en tous cas merci bien beaucoup tu es la reine

  10. #10
    Membre éclairé
    Avatar de CPI_en_mousse
    Homme Profil pro
    Développeur Java
    Inscrit en
    Avril 2006
    Messages
    332
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2006
    Messages : 332
    Par défaut 2 forms, 1 action
    J'en profite également pour poser une tite question : Comment je peux faire pour savoir si l'action a été déclenché par la page1.jsp ou page2.jsp?

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Nom de la class Form ou Action
    Par zangets dans le forum Struts 1
    Réponses: 0
    Dernier message: 14/10/2010, 15h51
  2. html:form et action correspondante
    Par HozakaN dans le forum Struts 1
    Réponses: 4
    Dernier message: 22/05/2009, 09h14
  3. 1 form => 2 actions possible
    Par zoom61 dans le forum Général JavaScript
    Réponses: 2
    Dernier message: 15/06/2008, 10h38
  4. [Form] deux actions dans un formulaire ?
    Par FraK dans le forum Balisage (X)HTML et validation W3C
    Réponses: 21
    Dernier message: 16/07/2007, 15h11
  5. une <form> deux actions
    Par rexxys dans le forum Général JavaScript
    Réponses: 7
    Dernier message: 13/01/2007, 15h10

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