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 Java Discussion :

Probleme Tutoriel sur la réalisation d'application Web simple avec Spring


Sujet :

Spring Java

  1. #1
    Membre régulier
    Avatar de lionceau
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2008
    Messages
    148
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 34
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2008
    Messages : 148
    Points : 111
    Points
    111
    Par défaut Probleme Tutoriel sur la réalisation d'application Web simple avec Spring
    Bonjour,

    Dans la rubrique II-E. Passage de donnée à la JSP « bonjour.jsp » du tutoriel : sur la réalisation d'application Web simple avec Spring à cette adresse http://rpouiller.developpez.com/tuto...ing-hibernate/
    Je suis bloqué.

    Sur cette adresse http://localhost:8080/tutoriel-web-spring/bonjour ,
    j'ai ce message d'erreur sur le navigateur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    Etat HTTP 404 -
     
    type Rapport d''état
     
    message
     
    description La ressource demandée n''est pas disponible.

    J'ai ce message d'erreur en console :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    org.springframework.web.servlet.PageNotFound noHandlerFound
    WARNING: No mapping found for HTTP request with URI [/tutoriel-web-spring/vues/bonjour] in DispatcherServlet with name 'servlet-dispatcher'
    Pourquoi ?

    Merci,

    Lionceau.

  2. #2
    Membre confirmé Avatar de ruscov
    Homme Profil pro
    Architecte de système d'information
    Inscrit en
    Mars 2007
    Messages
    347
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39
    Localisation : Belgique

    Informations professionnelles :
    Activité : Architecte de système d'information

    Informations forums :
    Inscription : Mars 2007
    Messages : 347
    Points : 500
    Points
    500
    Par défaut
    A priori, je dirais que tu n'as pas de fichier bonjour.jsp dans ton dossier "vues". Ou alors tu ne l'as pas mis au bon endroit?
    Mes logiciels n’ont jamais de bug. Ils développent juste certaines fonctions aléatoires.

  3. #3
    Membre régulier
    Homme Profil pro
    Développeur Java
    Inscrit en
    Octobre 2010
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Cameroun

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

    Informations forums :
    Inscription : Octobre 2010
    Messages : 9
    Points : 83
    Points
    83
    Par défaut
    Je pense qu'il faut regarde au niveau de la définition du suffixe du resolveur de vue.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    	<property name="prefix">
    		<value>/vues/</value>
    	</property>
    	<property name="suffix">
    		<value>.jsp</value>
    	</property>
    </bean>
    Tu as probalement oublié la propriété Suffixe, c'est pourquoi on a pas .jsp à la fin de la ressource introuvable
    - N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  4. #4
    Nouveau Candidat au Club
    Homme Profil pro
    Développeur Java
    Inscrit en
    Novembre 2012
    Messages
    1
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Canada

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

    Informations forums :
    Inscription : Novembre 2012
    Messages : 1
    Points : 1
    Points
    1
    Par défaut effectivement j'ai le même bogue
    http://localhost:8080/tutoriel-web-spring/vues/bonjour
    erreur 404
    pourtant voilà mon fichier 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
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
        xmlns:mvc="http://www.springframework.org/schema/mvc"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/beans 
        <a href="http://www.springframework.org/schema/beans/spring-beans-4.0.xsd" target="_blank">http://www.springframework.org/schem...-beans-4.0.xsd</a>
        <a href="http://www.springframework.org/schema/context" target="_blank">http://www.springframework.org/schema/context</a>
        <a href="http://www.springframework.org/schema/context/spring-context-4.0.xsd" target="_blank">http://www.springframework.org/schem...ontext-4.0.xsd</a>
        <a href="http://www.springframework.org/schema/mvc" target="_blank">http://www.springframework.org/schema/mvc</a>
        <a href="http://www.springframework.org/schema/mvc/spring-mvc.xsd" target="_blank">http://www.springframework.org/schem...spring-mvc.xsd</a>
        <a href="http://www.springframework.org/schema/tx" target="_blank">http://www.springframework.org/schema/tx</a> http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
     
        <bean id="messageSource"
            class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
            <property name="basename" value="classpath:messages" />
            <property name="defaultEncoding" value="ISO-8859-1" />
        </bean>
     
        <context:component-scan base-package="com.developpez.rpouiller" />
     
        <bean
            class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="prefix">
                <value>/vues/</value>
            </property>
            <property name="suffix">
                <value>.jsp</value>
            </property>
        </bean>
     
    </beans>

Discussions similaires

  1. [MVC] Tutoriel sur la réalisation d'application Web simple avec Spring
    Par regis1512 dans le forum Spring Web
    Réponses: 45
    Dernier message: 20/09/2020, 16h34

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