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

Spring Web Java Discussion :

Erreur Projet Spring MVC


Sujet :

Spring Web Java

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2007
    Messages
    134
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Octobre 2007
    Messages : 134
    Points : 54
    Points
    54
    Par défaut Erreur Projet Spring MVC
    Bonjour à tous,

    Je réalise un petit formulaire afin d'apprendre Spring MVC mais j'ai cette erreur:

    GRAVE: "Servlet.service()" pour la servlet jsp a g�n�r� une exception
    javax.servlet.jsp.JspTagException: Neither BindingResult nor plain target object for bean name 'participant' available as request attribute
    at org.springframework.web.servlet.tags.BindTag.doStartTagInternal(BindTag.java:120)
    at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:77)
    at org.apache.jsp.inscription_jsp._jspService(inscription_jsp.java:120)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)
    Voici mon controlleur:

    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
     
    public class HelloController extends SimpleFormController {
        private HelloService helloService;
        private ImplParticipantDao implParticipantDao;
    ...getter et setter...
        public HelloController() {
            setCommandClass(Participant.class); //Class
            setCommandName("participant"); //Nom du champs !
            setSuccessView("encours"); // En cas de succes,l'action du formulaire !
            setFormView("inscription"); //Nom de mon fichier !
        }
     
        @Override
        protected ModelAndView onSubmit(Object command) throws Exception{
            Participant participant =(Participant)command;
            ModelAndView mv = new ModelAndView(getSuccessView());
            implParticipantDao.addParticipant(participant);
            mv.addObject("participant", helloService.addParticipant());
            return mv;
        }
    }
    applicatinContext.xml:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    ...
    <!-- Les classe metiers -->
        <bean name="helloService" class="be.appl.metier.HelloService" />
        <bean name="implParticipantDao" class="be.appl.concours.dao.ImplParticipantDao" />
    ...
    dispatcher-servlet.xml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    ...<bean class="be.appl.controller.HelloController">
            <property name="helloService" ref="helloService"/>
            <property name="implParticipantDao" ref="implParticipantDao"/>
        </bean>...
    Je n'arrive même pas à accéder à mon formulaire JSP que voici:
    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
    <h2>Inscription</h2>
            <spring:nestedPath path="participant">
                <table width="600px" border="0">
                <form action="" method="post">
                    <tr>
                        <td width="300px">Name:</td>
                        <spring:bind path="participant.nom">
                        <td><input type="text" name="${status.expression}" value="${status.value}" ></td>
                        </spring:bind><br>
                    </tr>
                    <tr>
                        <td>Prénom:</td>
                        <spring:bind path="participant.prenom">
                            <td><input type="text" name="${status.expression}" value="${status.value}"></td>
                        </spring:bind>
                    </tr>
                    <tr>
                        <td>Login:</td>
                        <spring:bind path="participant.login">
                            <td><input type="text" name="${status.expression}" value="${status.value}"></td>
                        </spring:bind>
                    </tr>
                    <tr>
                        <td>Mots de passe:</td>
                        <spring:bind path="participant.mp">
                            <td><input type="text" name="${status.expression}" value="${status.value}"></td>
                        </spring:bind>
                    </tr>
                    <tr>
                        <td>Confirmer le mots de passse:</td>
                        <spring:bind path="participant.mp">
                            <td><input type="text" name="${status.expression}" value="${status.value}"></td>
                        </spring:bind>
                    </tr>
                    <tr>
                        <td>Mail:</td>
                        <spring:bind path="participant.mail">
                           <td><input type="text" name="${status.expression}" value="${status.value}"></td>
                        </spring:bind>
                    </tr>
                    <tr>
                        <td>Numéro du bureau:</td>
                        <spring:bind path="participant.bureau">
                            <td><input type="text" name="${status.expression}" value="${status.value}"></td>
                        </spring:bind>
                    </tr>
                    <tr>
                        <td>Téléphone bureau:</td>
                        <spring:bind path="participant.telephone">
                            <td><input type="text" name="${status.expression}" value="${status.value}"></td>
                        </spring:bind>
                    </tr><p></p>
                    <tr>
                        <td></td>
                        <td>
                            <input type="submit" value="Enregistrer"><input type="reset" value="Annuler">
                        </td>
                    </tr>
                </form>
                </table>
            </spring:nestedPath>
    Avez vous une idée ?

    D'avance merci à tous

  2. #2
    Membre expérimenté
    Avatar de Patriarch24
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Septembre 2003
    Messages
    1 047
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Industrie

    Informations forums :
    Inscription : Septembre 2003
    Messages : 1 047
    Points : 1 640
    Points
    1 640
    Par défaut
    Je réalise un petit formulaire afin d'apprendre Spring MVC mais j'ai cette erreur:
    Tu utilises une ancienne version de spring (2.0 d'après ce que je peux lire). Pourquoi ne pas essayer avec une version plus récente (3.0) ?

Discussions similaires

  1. Fichier properties dans un projet Spring MVC
    Par khayem dans le forum Spring
    Réponses: 5
    Dernier message: 27/02/2013, 14h43
  2. Réponses: 3
    Dernier message: 22/07/2012, 22h16
  3. [MVC] Remonter d'erreur dans un projet web MVC & Spring
    Par thebestfriend dans le forum Spring Web
    Réponses: 0
    Dernier message: 30/06/2010, 08h20
  4. [Spring MVC][Validator] Ne stop pas si il y a une erreurs
    Par Hikage dans le forum Spring Web
    Réponses: 3
    Dernier message: 15/02/2006, 09h43

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