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 :

Erreur HTTP 400


Sujet :

Spring Java

  1. #1
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Août 2012
    Messages
    22
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Italie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Août 2012
    Messages : 22
    Par défaut Erreur HTTP 400
    Bonjour tout le monde,

    je reviens vers vous. Cette fois-ci il s'agit de l'erreur http 400.

    Je suis entrain de vouloir inserer les donnés dans une table dans ma base de données. Cette table a une foreign key parmi ses colonnes. Elle a une relation manytoone avec la table dont elle possède la foreign key.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
    Quand je lance l'application,je reçois cette erreur: 
     
    HTTP Status 400 -
     
    type Status report
     
    message
     
    description The request sent by the client was syntactically incorrect.
    Apache Tomcat/7.0.34
    Voici les codes et la configuration
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Classe de service: SpettacoloServices.java du package starcinema.services
    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
     
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package starcinema.services;
     
    import java.util.List;
    import javax.annotation.Resource;
     
    import org.hibernate.Query;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Service;
    import org.springframework.transaction.annotation.Transactional;
    import starcinema.model.Film;
    import starcinema.model.Spettacolo;
     
     
    /**
     *
     * @author simon
     */
    @Service("spettacoloService")
     @Transactional
    public class SpettacoloServices 
    {
         @Autowired
         @Resource(name="sessionFactory")
         private SessionFactory sessionFactory;
     
            Session session= null;
     
     public List<Spettacolo> getAllspettacolo(Integer idfilm) {
     
       session = sessionFactory.getCurrentSession();
       Query query = session.createQuery("FROM  Spettacolo WHERE idf=" +idfilm);
       return  query.list();
     }
     
     
     public List<Spettacolo> getAll() {
     
       session = sessionFactory.getCurrentSession();
     
     
      Query query = session.createQuery("FROM  Spettacolo");
       return  query.list();
     }
     
     
     public Spettacolo get( Integer idspettacolo ) 
     {
     session = sessionFactory.getCurrentSession();
     
     
      Spettacolo spettacolo = (Spettacolo) session.get(Spettacolo.class, idspettacolo);
     
     
      return spettacolo;
     }
     
     
     public void addspettacolo(Integer idfilm, Spettacolo spettacolo) {
     
     
     
     session = sessionFactory.getCurrentSession();
     
     
      Film existingFilm = (Film) session.get(Film.class, idfilm);
     
     
      spettacolo.setFilm(existingFilm);
     
     
      session.save(spettacolo);
     }
     
     
    }
    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
     
     
     
    @Controller
     
    public class ControllerServlet 
    {
    @Resource(name="spettacoloService")
        private SpettacoloServices spettacoloService;
    .....
    ......
     
    @RequestMapping(value = "admin.do", method=RequestMethod.GET)
        public String getAdd(@RequestParam("idfilm") Integer idfilm, Model model)
            {
                Spettacolo spettacolos  = new Spettacolo();
                 spettacolos.setFilm(filmService.getfilm(idfilm));
                 model.addAttribute("spettacolo", spettacolos);
                return "admin";
            }
     
            @RequestMapping(value = "listspettacolo.do")
             public String insertspettacolo(Model model)
          {
            spettacoloService.getAll();
                return "listspettacolo";
          }
        @RequestMapping(value = "insertspettacolo.do", method=RequestMethod.POST)
       public String insertspettacolo(@ModelAttribute() Spettacolo spettacolos, @RequestParam("idfilm") Integer idfilm,  Model model)
          {
            spettacoloService.addspettacolo(idfilm, spettacolos);
                return "listspettacolo";
          }
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    <%--
    Views should be stored under the WEB-INF folder so that
    they are not accessible except through controller process.
     
    This JSP is here to provide a redirect to the dispatcher
    servlet but should be the only JSP outside of WEB-INF.
    --%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <% response.sendRedirect("admin.do"); %>
    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
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>Starcinema</title>
        </head>
     
        <body>
           <table border="0">
          <tr><th>Titolo del film per qui si vuole inserire lo spettacolo</th></tr>
              <c:forEach var="film" items="${films}">
            <tr>
     
                <td><a href="listspettacolo.do?idfilm=${idfilm}"><ul>${film.titolo}</ul></a></td>
            </tr>
          </c:forEach>
        </table>
        </body>
    </html>
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    listspettacolo.jsp: dans ceci j'ai deux tables, une pour m'afficher les spettacles qui sont déjà dans la base de données et une autre pour me permettre d'y inserer les données
    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
     
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title><img src="images/img/admin.jpg"/> ADMIN </title>
        </head>
        <body>
               <h1>Titolo Film: ${film.titolo}</h1>
        <br/>
     
        <table border="2">
          <tr><th>Prezzo</th><th>Ora</th><th>Data</th><th>Sala</th></tr>
              <c:forEach var="spettacolo" items="${spettacolos}">
            <tr>
              <td>${spettacolo.prezzo}</td>
              <td>${spettacolo.ore}</td>
              <td>${spettacolo.data}</td>
              <td>${spettacolo.numsala}</td>
            </tr>
          </c:forEach>
        </table>
     
        <br/>
     
        <h2>Add spettacolo</h2>
     
        <form name="spettacoloInsertForm" action="insertspettacolo.do" method="post">
     
          <table border="2">
     
            <tr>
              <td>Prezzo</td>
              <td><input type="text" name="prezzo" value=""</td>
            </tr>
     
            <tr>
              <td>Ora</td>
              <td><input type="text" name="ore" value=""</td>
            </tr>
            <tr>
              <td>Data</td>
              <td><input type="text" name="data" value=""</td>
            </tr>
            <tr>
              <td>Sala</td>
              <td><input type="text" name="numsala" value=""</td>
            </tr>
        </table>
     
          <input type="hidden" name="idfilm" value="${idfilm}"/>
     
          <input type="submit" value="ok"/>
     
        </form>
     
     
     
     
         </body>
    </html>
    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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/applicationContext.xml</param-value>
     
        </context-param>
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        <servlet>
            <servlet-name>dispatcher</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <load-on-startup>2</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>dispatcher</servlet-name>
            <url-pattern>*.do</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>redirect.jsp</welcome-file>
        </welcome-file-list>
    </web-app>
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Application Context.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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:p="http://www.springframework.org/schema/p"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
          <!--property name="dataSource"><ref local="dataSource"/></property-->
          <property name="configLocation">
              <value>classpath:hibernate.cfg.xml</value>
          </property>
      </bean>
     
     
     
     
    </beans>
    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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:p="http://www.springframework.org/schema/p"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xmlns:context="http://www.springframework.org/schema/context"
     
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
     
           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
     
    ">
     
      <context:component-scan base-package="starcinema"/>
      <context:annotation-config/>
     
     
     
      <bean id="viewResolver"
            class="org.springframework.web.servlet.view.InternalResourceViewResolver"
            p:prefix="/WEB-INF/jsp/"
            p:suffix=".jsp" />
    </beans>

    J'utilise toujours netbeans, apache Tomcat 7.0.34 spring 3.1.1 et hibernate
    3.2.5.

    Pouriez-vous me donner encore un coup de main?
    Je ne comprends pas pourquoi je dois avoir cette erreur pourtant me sembre ok.
    Merci d'avance!

  2. #2
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Par défaut
    Bonsoir,

    1- Prend l'habitude de mettre un "/" pour les chemins dans le RequestMapping et le lien dans le jsp.
    2-
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <a href="listspettacolo.do?idfilm=${idfilm}">
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <a href="listspettacolo.do?idfilm=${film.idfilm}">
    3-
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    public String insertspettacolo(Model model)
          {
            spettacoloService.getAll();
                return "listspettacolo";
          }
    Tu dois mettre la valeur retournée par spettacoloService.getAll() dans le model
    4-
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <input type="hidden" name="idfilm" value="${idfilm}"/>
    Tu dois mettre aussi idfilm dans le model.


    A+.

  3. #3
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    The request sent by the client was syntactically incorrect.
    Dans tout ce code posté, c'est quoi le client? Parce que le problème c'est que le client envoie n'importe quoi et je ne vois que le code du serveur là

  4. #4
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Août 2012
    Messages
    22
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Italie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Août 2012
    Messages : 22
    Par défaut
    Merci deja pour la reponse. Actuellement je ne peux pas mettre les mains sur le code car machine a des problèmes. Je vous direz comment les choses evolues dès que possible. Merci encore

  5. #5
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Août 2012
    Messages
    22
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Italie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Août 2012
    Messages : 22
    Par défaut
    Citation Envoyé par tchize_ Voir le message
    Dans tout ce code posté, c'est quoi le client? Parce que le problème c'est que le client envoie n'importe quoi et je ne vois que le code du serveur là
    Le client ce sont ces deux page jsp: admin.jsp et listspettacolo.jsp.

    admin.jsp demande au server de lui donner les id des films et les titres correspondant. Ils apparaitront sous forme de lien. Quand je cliquerai dessus, j'irai à la page listspettacoloj.sp qui me fera voir les spettacles correspondant à l'id et au titre du film. J'ai la possibilité d'en inserer d'autre. Et c'est ce que je voudrais justement faire. Mais je n'y arrive pas.

  6. #6
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Par défaut
    As-tu corrigés les erreurs cités précédemment? Ce que tu nous as donné sont du coté serveur, ce que tchize_ te demande c'est du coté client (navigateur).

    A+.

  7. #7
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Citation Envoyé par noumedem Voir le message
    Le client ce sont ces deux page jsp: admin.jsp et listspettacolo.jsp.
    A moins que tes JSP ne se connectent à un autre serveur HTTP, genre un web service, ce ne sont pas des clients, c'est le serveur.


    Ton client (navigateur), c'est quoi? Il a envoyé quoi comme requête à ton serveur? Eventuellement, fait un sniff de la connexion avec wireshark et envoie nous le fichier dump que tu obtiens.

  8. #8
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Août 2012
    Messages
    22
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Italie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Août 2012
    Messages : 22
    Par défaut
    Bonjour Tchize et Andry.aime,

    @Tchize

    j'utilise comme navigateur Firefox. Il envoie cette la requete suivante au serveur:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     http://localhost:8084/starcinema/admin.do
    -starcinema c'est le nom de mon projet que j'ai defini dans netbeans
    -admin c'est le fichier jsp que le serveur est censé avoir.

    Mais après a requete le client me fait voir ceci:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    HTTP Status 400 -
     
    type Status report
     
    message
     
    description The request sent by the client was syntactically incorrect.
    Apache Tomcat/7.0.34
    admin doit me renvoyer les titres des films sous forme de lien comme j'ai defini dans le fichier jsp. Si je clique sur un titre de film je dois voir les spettacles correspondant à ce titre et la possibilité d'inserer d'autres spettacles.

    @Andry.aime

    1-
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1- Prend l'habitude de mettre un "/" pour les chemins dans le RequestMapping et le lien dans le jsp.
    Je ne comprends pas bien. Peux-tu m'illustrer cela avec un exemple?

    -2
    J'ai corrigé ce que tu m'as demandé de faire.
    ça ne marche pas.
    C'est en regardant bien le code que je me suis rendu compte que je demandais à la base de données de me faire voir toute la liste des spettacles. En fait ce n'est pas ce que je veux.
    Je voudrais plutot voir la liste des spettacles correspondant à un idfilm ou titre de film.
    Par consequent je ne dois pas utiliser le getAll()
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
      @RequestMapping(value = "listspettacolo.do")
             public String insertspettacolo(Model model)
          {
            spettacoloService.getAll();
                return "listspettacolo";
          }
    mais plutot getAllspettacolo(idfilm)

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
      @RequestMapping(value = "listspettacolo.do", method=RequestMethod.GET)
             public String listspettacolo(@RequestParam("idfilm") Integer idfilm, Model model)
          {
              List<Spettacolo> spettacolos;
            spettacolos = spettacoloService.getAllspettacolo(idfilm);
            model.addAttribute("spettacolos", spettacolos);
     
                return "listspettacolo";
          }
    Je reçois la meme erreur.

    Je redis ce que je voudrais faire:

    En fait j'ai deux tables dans ma base de données. L'une s'appelle film et à pour clé: idfilm. Elle contient les colonnes idfilm, description, lientrailer... L'autre s'appelle spettacolo. Elle a pour clé idspettacolo. Elle a pour colonnes idspettacolo, date, heure et 'la clé externe idf' qui est en fait la clé de la table film. J'ai à faire à une relation manytoone. Dans le table spettacolo, je peux avoir plusieurs spettacles qui correspondent à un seul film.

    Je voudrais inserer les données dans la table spettacolo en tenant compte du film pour lequel j'insère le spettacle.

    C'est cela mon cauchemar depuis plus d'une semaine

    Je vous prie de m'aider, je suis debutant.

    Merci encore

  9. #9
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Citation Envoyé par noumedem Voir le message
    Bonjour Tchize et Andry.aime,

    @Tchize

    j'utilise comme navigateur Firefox. Il envoie cette la requete suivante au serveur:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     http://localhost:8084/starcinema/admin.do
    Ce devrait être
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    http://localhost:8084/starcinema/admin.do?idfilm=123
    vu ton mapping

  10. #10
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Août 2012
    Messages
    22
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Italie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Août 2012
    Messages : 22
    Par défaut
    Citation Envoyé par tchize_ Voir le message
    Ce devrait être
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    http://localhost:8084/starcinema/admin.do?idfilm=123
    vu ton mapping
    Quand j'écris manuellement après avoir reçu l'erreur 400:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    http://localhost:8084/starcinema/admin.do?idfilm=1
    je reçois une exception

    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
     
    HTTP Status 500 - An exception occurred processing JSP page /WEB-INF/jsp/admin.jsp at line 23
     
    type Exception report
     
    message An exception occurred processing JSP page /WEB-INF/jsp/admin.jsp at line 23
     
    description The server encountered an internal error that prevented it from fulfilling this request.
     
    exception
     
    org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/jsp/admin.jsp at line 23
     
    20:     <table border="0">
    21:       <tr><th>Titolo film</th></tr>
    22:       
    23:           <c:forEach var="film" items="${films}">
    24:               
    25:         <tr>
    26:           <td><a href="listspettacolo.do?idfilm=${film.idfilm}">${film.titolo}</a></td>
     
     
    Stacktrace:
    	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    	org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    	org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
    	org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
    	org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    	org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
     
    root cause
     
    javax.servlet.ServletException: javax.servlet.jsp.JspTagException: Don't know how to iterate over supplied "items" in &lt;forEach&gt;
    	org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:912)
    	org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:841)
    	org.apache.jsp.WEB_002dINF.jsp.admin_jsp._jspService(admin_jsp.java:97)
    	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    	org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    	org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
    	org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
    	org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    	org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
     
    root cause
     
    javax.servlet.jsp.JspTagException: Don't know how to iterate over supplied "items" in &lt;forEach&gt;
    	org.apache.taglibs.standard.tag.common.core.ForEachSupport.toForEachIterator(ForEachSupport.java:255)
    	org.apache.taglibs.standard.tag.common.core.ForEachSupport.supportedTypeForEachIterator(ForEachSupport.java:219)
    	org.apache.taglibs.standard.tag.common.core.ForEachSupport.prepare(ForEachSupport.java:137)
    	javax.servlet.jsp.jstl.core.LoopTagSupport.doStartTag(LoopTagSupport.java:227)
    	org.apache.jsp.WEB_002dINF.jsp.admin_jsp._jspx_meth_c_005fforEach_005f0(admin_jsp.java:119)
    	org.apache.jsp.WEB_002dINF.jsp.admin_jsp._jspService(admin_jsp.java:85)
    	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    	org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
    	org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238)
    	org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262)
    	org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    	org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
     
    note The full stack trace of the root cause is available in the Apache Tomcat/7.0.34 logs.
    Apache Tomcat/7.0.34

  11. #11
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    ${films} est de quel type? Visiblement, ce n'est pas un java.util.List

  12. #12
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Août 2012
    Messages
    22
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Italie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Août 2012
    Messages : 22
    Par défaut
    Citation Envoyé par tchize_ Voir le message
    ${films} est de quel type? Visiblement, ce n'est pas un java.util.List
    voici les methodes qui me permettent d'ajouter et de recuperer des films

    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
     
    package starcinema.services;
     
     
    import java.util.List;
    import javax.annotation.Resource;
    import org.hibernate.Query;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Service;
    import org.springframework.transaction.annotation.Transactional;
    import starcinema.model.Film;
     
    /**
     *
     * @author simon
     */
    @Service("filmService")
     
      @Transactional
    public class FilmServices
    {
        @Autowired
        @Resource(name="sessionFactory")
      private SessionFactory sessionFactory;
        Session session=null;
     
     
      public List<Film> getallfilms() 
      {
      session = sessionFactory.getCurrentSession();
      session.beginTransaction();
      Query query = session.createQuery("FROM Film");
      return  query.list();
     }
     
     
     
       public Film getfilm(Integer idfilm) 
     {
          session = sessionFactory.getCurrentSession();
         session.beginTransaction();
        Film film = (Film) session.get(Film.class, idfilm);
        return film;  
     }
     
       public List<Film> addfilm(Film  film) 
     {
          try {
     
        session = sessionFactory.getCurrentSession();
         session.beginTransaction();
        session.save(film);
        session.getTransaction().commit();
        } catch (Throwable t) {
          System.err.println(t);
          t.printStackTrace(System.err);
          session.getTransaction().rollback();
     
        } finally {
          if (session.isOpen()) {
            session.close();
          }
        }
          return (List)film;
     }
    }
    J'envoie aussi le controller complet:

    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
     
    package starcinema.controller;
     
     
     
    import java.util.ArrayList;
    import java.util.List;
    import javax.annotation.Resource;
    import org.springframework.stereotype.Controller;
    import org.springframework.ui.Model;
    import org.springframework.web.bind.annotation.ModelAttribute;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestMethod;
    import org.springframework.web.bind.annotation.RequestParam;
    import starcinema.dto.FilmDTO;
     
    import starcinema.model.Film;
    import starcinema.model.Spettacolo;
     
    import starcinema.model.Utente;
    import starcinema.services.FilmServices;
    import starcinema.services.SpettacoloServices;
    import starcinema.services.UtenteServices;
     
     
     
    @Controller
     
    public class ControllerServlet 
    {
         @Resource(name="filmService")
        private FilmServices filmService;
         @Resource(name="utenteService")
        private UtenteServices utenteService;
            @Resource(name="spettacoloService")
        private SpettacoloServices spettacoloService;
     
         @RequestMapping(value = "filmsList.do")
        public String filmsList(Model model) 
        {
             List<Film> films = filmService.getallfilms();
          List<FilmDTO> filmsDTO = new ArrayList<FilmDTO>();
            for (Film film: films) 
            {
     
             FilmDTO dto = new FilmDTO();
     
            dto.setIdfilm(film.getIdfilm());
            dto.setTitolo(film.getTitolo());
            dto.setDescrizione(film.getDescrizione());
             dto.setLinktrailer(film.getLinktrailer());
         dto.setNomeimmagine(film.getNomeimmagine());
          dto.setSpettacolo(spettacoloService.getAllspettacolo(film.getIdfilm()));
     
       // Add to model list
      filmsDTO.add(dto);
         }
     
         // Add to model
         model.addAttribute("films", filmsDTO);
     
     
             return "filmsList";
         }
     
        @RequestMapping(value = "insertfilm.do")
        public String insertfilm(@ModelAttribute Film film, Model model) 
        {
            List<Film> films;
                films=filmService.addfilm(film);
                model.addAttribute("films", films);
                return "filmsList";
         }
     
          @RequestMapping(value = "registrarsi.do")
       public String registrarsi(@ModelAttribute() Utente utentes,  Model model)
          {
              utenteService.addutente(utentes, 2);
              model.addAttribute("utentes", utentes);
              return"registrarsi";
          }
            @RequestMapping(value = "admin.do", method=RequestMethod.GET)
        public String getAdd(@ModelAttribute() Spettacolo spettacolos,@RequestParam("idfilm") Integer idfilm, Model model)
            {
               //List<Film> films;
                 spettacolos.setFilm(filmService.getfilm(idfilm));
                 model.addAttribute("spettacolos", spettacolos);
                // model.addAttribute("films", films);
                return "admin";
            }
     
           @RequestMapping(value = "listspettacolo.do", method=RequestMethod.GET)
             public String listspettacolo(@RequestParam("idfilm") Integer idfilm, Model model)
          {
              List<Spettacolo> spettacolos;
            spettacolos = spettacoloService.getAllspettacolo(idfilm);
            model.addAttribute("spettacolos", spettacolos);
     
                return "listspettacolo";
          }
        @RequestMapping(value = "insertspettacolo.do", method=RequestMethod.POST)
       public String insertspettacolo(@ModelAttribute() Spettacolo spettacolos, @RequestParam("idfilm") Integer idfilm,  Model model)
          {
     
            spettacoloService.addspettacolo(idfilm, spettacolos);
            model.addAttribute("spettacolos", spettacolos);
     
                return "admin";
          }
    }
    Justement ${films} n'est pas du type list.

    j'ai fait un cast (list) sur la valeur retournée de la methode addfilm dans le service.

    Au niveau client je reçois:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    Film
     
    Titolo film
    quand je fais la requete:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    http://localhost:8084/starcinema/admin.do?idfilm=1
    Donc je ne recupère aucun film.

    Comment faire

  13. #13
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Citation Envoyé par noumedem Voir le message
    voici les methodes qui me permettent d'ajouter et de recuperer des films
    Et je suis censé deviner dans tous ce bordel ce que tu as mis dans ta variable films au niveau de la jsp?
    Citation Envoyé par noumedem Voir le message
    Justement ${films} n'est pas du type list.
    Ben c'est quoi alors


    Donc je ne recupère aucun film.

    Comment faire
    Ben tu récupère le film passé en paramètre. Et vu que c'est un seul film, a priori, tu vire cette itération qui n'a aucun sens.

  14. #14
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Août 2012
    Messages
    22
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Italie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Août 2012
    Messages : 22
    Par défaut
    Citation Envoyé par tchize_ Voir le message
    Et je suis censé deviner dans tous ce bordel ce que tu as mis dans ta variable films au niveau de la jsp?

    Ben c'est quoi alors



    Ben tu récupère le film passé en paramètre. Et vu que c'est un seul film, a priori, tu vire cette itération qui n'a aucun sens.
    la variable film en fait est de type Film; Film etant bien evidement la classe Film.java du model.
    Je crois qu'il faut que je declaire Film comme array du genre: Film[] film;
    Puis je declarerai une autre variable filmList de type List qui me recevra le resultat de la query. Puis je ferai film = filmList.toArray(new Film[0]);
    Bon je crois que ainsi cela pourra marcher. Je ne sais pas si je me trompe.

    Tchize, je crois qu'il faut que je reussi à faire cela avant de voir le problème de l'erreur 400. En fait quand je lance l'application elle me donne directement cette erreur 400; c'est quand j'inserère manuellement dans l'url (...?idfilm=1) par exemple que ça tourne; or cela ne doit pas ainsi.

    Merci d'avance en attendant tes eventuelle suggestions

  15. #15
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Citation Envoyé par noumedem Voir le message
    Je crois qu'il faut que je declaire Film comme array du genre: Film[] film;
    Ben non, faut que tu arrête d'essayer d'itérer sur un truc qui ne contient par définition que 1 élément:

    Citation Envoyé par noumedem Voir le message
    avant de voir le problème de l'erreur 400
    Déjé résolu: tu oublie le paramètre idFilm dans ta requete.

  16. #16
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Août 2012
    Messages
    22
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Italie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Août 2012
    Messages : 22
    Par défaut
    Citation Envoyé par tchize_ Voir le message
    Ben non, faut que tu arrête d'essayer d'itérer sur un truc qui ne contient par définition que 1 élément:


    Déjé résolu: tu oublie le paramètre idFilm dans ta requete.
    Ok Tchize, je corrige rapidement ce qui ne va pas.

    Une curiosité: lorsqu'on developpe une application mvc model 2, il est preferable de faire le controller dans une seule classe java ou d'en faire plusieurs selon les necessités (bien evidemment dans le package controller)?
    Merci

  17. #17
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Autant que nécessaire, si tu ne veux pas te retrouver avec un classe gigantesque. Pense aux gens qui passent après toi.

  18. #18
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Août 2012
    Messages
    22
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Italie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Août 2012
    Messages : 22
    Par défaut
    Citation Envoyé par tchize_ Voir le message
    Autant que nécessaire, si tu ne veux pas te retrouver avec un classe gigantesque. Pense aux gens qui passent après toi.
    Merci bien Tchize

  19. #19
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Août 2012
    Messages
    22
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Italie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Août 2012
    Messages : 22
    Par défaut
    Bonjour tout le monde,

    je reviens encore vers vous pour vous dire ce qu'il en est de ma preocuppation.
    J'ai encore travaillé sur les codes en tenant compte de vos conseils sur le mapping, la lisibilité du code et bien d'autres. Mais jusqu'ici je n'obtiens pas encore ce que je veux si oui une erreur 404:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    HTTP Status 404 - /starcinema/admin
     
    type Status report
     
    message /starcinema/admin
     
    description The requested resource is not available.
    Apache Tomcat/7.0.34
    S'il vous plait je vous prie d'etre patients avec moi car je ne suis qu'un debutant. Si je comprend bien le pourquoi ça ne marche pas, alors je pourrais debloquer d'autres problèmes et aider aussi les autres.
    Je compte tant sur vous. Je voudrais savoir où je peche depuis dans cet exercice.

    J'ai pris la peine de bien rendre le code lisible.

    En fait ce que je veux faire c'est lire contemporainement les données qui sont dans deux tables (film et spettacolo). Ces tables sont en relation (voir pièce jointe). En plus de lire les données, je veux aussi les inserer.
    Voici ce que j'ai:

    1- Je commence par les services (accès à la base de données)
    a) FilmServices.java

    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
     
    package starcinema.services;
     
     
    import java.util.List;
    import javax.annotation.Resource;
    import org.hibernate.Query;
     
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
     
    import org.springframework.stereotype.Service;
    import org.springframework.transaction.annotation.Transactional;
    import starcinema.model.Film;
     
    /**
     *
     * @author simon
     */
    @Service("filmService")
     
     @Transactional
    public class FilmServices
    {
     
     
        @Resource(name="sessionFactory")
      private SessionFactory sessionFactory;
        Session session=null;
     
     
     
         /**
      * Recupere tous les films
      */
      public List<Film> getall() 
      {
     
        //Recupere la session de Hibernate
      session = sessionFactory.getCurrentSession();
      // Cré un  Hibernate query (HQL)
      Query query = session.createQuery("FROM Film");
      // Retourne la liste de tous les film
      return  query.list();
     }
     
     
      /**
      * Recupere un seul film
      */ 
       public Film get(Integer idfilm) 
     {
         //Recupere la session de Hibernate
          session = sessionFactory.getCurrentSession();
        //Recupere un film existent
        Film film = (Film) session.get(Film.class, idfilm);
        //Retourne le film demandé correspondent a idfilm
        return film;  
     }
     
        /**
      * Ajoute un film dans le  db
      */
       public void add(Film  film) 
     {
     
         //Recupere la session de Hibernate
        session = sessionFactory.getCurrentSession();
         //sauvegarde le film
        session.save(film);
     
     }
    }
    b) SpettacoloServices.java

    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
     
    package starcinema.services;
     
    import java.util.List;
    import javax.annotation.Resource;
     
    import org.hibernate.Query;
    import org.hibernate.Session;
     
    import org.hibernate.SessionFactory;
    import org.springframework.stereotype.Service;
    import org.springframework.transaction.annotation.Transactional;
    import starcinema.model.Film;
    import starcinema.model.Spettacolo;
     
     
    /**
     *
     * @author simon
     */
    @Service("spettacoloService")
     @Transactional
    public class SpettacoloServices 
    {
         @Resource(name="sessionFactory")
         private SessionFactory sessionFactory;
     
            Session session= null;
     
             /**
      * Recupre tous les spectacles correspondant a idfilm (idf) dans la table des spetacles
      */
     public List<Spettacolo> getAll(Integer idfilm) 
     {
     
       //Recupere la session de Hibernate
       session = sessionFactory.getCurrentSession();
       // Cré un  Hibernate query (HQL)
       Query query = session.createQuery("FROM  Spettacolo WHERE idf=" +idfilm);
        // Retourne tous les spectacles correspondant a idfilm
       return  query.list();
     }
     
     
      /**
      * Recupere tous les spettacles
      */
     public List<Spettacolo> getAll() {
     
       session = sessionFactory.getCurrentSession();
     
    // Cré un Hibernate query (HQL)
      Query query = session.createQuery("FROM  Spettacolo");
      // Retourne tous les spetacles
       return  query.list();
     }
     
    /**
      * Ricupere  un seul spetacle
      */
     public Spettacolo get( Integer idspettacolo ) 
     {
          //Ricupere la session de Hibernate
     session = sessionFactory.getCurrentSession();
     
     // Ricupere le spectacle existante 
      Spettacolo spettacolo = (Spettacolo) session.get(Spettacolo.class, idspettacolo);
     
      // Retourne le
      return spettacolo;
     }
     
      /**
      * Ajoute un spectacle
      */
     public void add(Integer idfilm, Spettacolo spettacolo) 
     {
     
       //Recupere la session de Hibernate
      session = sessionFactory.getCurrentSession();
     
      // Recupère un fil existant via id
      Film existingFilm = (Film) session.get(Film.class, idfilm);
     
      // Ajoute l'id du film dans la table spectacle
      spettacolo.setFilm(existingFilm);
     
      // Sauvegarde le spectacle
      session.save(spettacolo);
     }
     
     
    }
    2) FilmDTO.java (Data Tranfert Object): me permet de recuperer les données contemporainement de la base de données.

    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
     
    package starcinema.dto;
     
     
    import java.util.List;
     
    import starcinema.model.Spettacolo;
     
    /**
     *
     * @author simon
     */
    public class FilmDTO 
    {
     
          private Integer idfilm;
         private String titolo;
         private String descrizione;
         private String linktrailer;
         private String nomeimmagine;
         private List< Spettacolo> spettacolo;
     
        public Integer getIdfilm() {
            return idfilm;
        }
     
        public void setIdfilm(Integer idfilm) {
            this.idfilm = idfilm;
        }
     
        public String getTitolo() {
            return titolo;
        }
     
        public void setTitolo(String titolo) {
            this.titolo = titolo;
        }
     
        public String getDescrizione() {
            return descrizione;
        }
     
        public void setDescrizione(String descrizione) {
            this.descrizione = descrizione;
        }
     
        public String getLinktrailer() {
            return linktrailer;
        }
     
        public void setLinktrailer(String linktrailer) {
            this.linktrailer = linktrailer;
        }
     
        public String getNomeimmagine() {
            return nomeimmagine;
        }
     
        public void setNomeimmagine(String nomeimmagine) {
            this.nomeimmagine = nomeimmagine;
        }
     
        public List< Spettacolo> getSpettacolo() {
            return spettacolo;
        }
     
        public void setSpettacolo(List< Spettacolo> spettacolo) {
            this.spettacolo = spettacolo;
        }
    }
    3) Les Controlleur
    a) FilmControler.java

    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
     
    package starcinema.controller;
     
     
     
    import java.util.ArrayList;
    import java.util.List;
    import javax.annotation.Resource;
     
    import org.springframework.stereotype.Controller;
    import org.springframework.ui.Model;
    import org.springframework.web.bind.annotation.ModelAttribute;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestMethod;
    import starcinema.dto.FilmDTO;
    import starcinema.model.Film;
    import starcinema.services.FilmServices;
    import starcinema.services.SpettacoloServices;
     
     
     
    @Controller
    @RequestMapping("/film")
    public class FilmController 
    {
     
         @Resource(name="filmService")
        private FilmServices filmService;
        @Resource(name="spettacoloService")
        private SpettacoloServices spettacoloService;
     
     
        /**
      * Recupere tous les films et spectacles correspondants
      */
        @RequestMapping(value = "/list", method = RequestMethod.GET)
        public String getprogrammazione(Model model) 
        {
     
            // Ricupera tutti i film
             List<Film> films = filmService.getall();
             // Prepara il  model object
          List<FilmDTO> filmsDTO = new ArrayList<FilmDTO>();
            for (Film film: films) 
            {
        // Crea un nuovo data transfer object
             FilmDTO dto = new FilmDTO();
     
            dto.setIdfilm(film.getIdfilm());
            dto.setTitolo(film.getTitolo());
            dto.setDescrizione(film.getDescrizione());
             dto.setLinktrailer(film.getLinktrailer());
         dto.setNomeimmagine(film.getNomeimmagine());
          dto.setSpettacolo(spettacoloService.getAll(film.getIdfilm()));
     
       // Ajoute dans le model list
      filmsDTO.add(dto);
         }
     
         // Add dans le model
     
         model.addAttribute("films", filmsDTO);
     
     
             return "programmazione";
         }
     
     
        /**
         *  Recupere la page pour ajouter un film
         */
            @RequestMapping(value = "/add", method = RequestMethod.GET)
             public String getAdd(Model model) {
     
     
         // Cré un nouveau film et ajoute dans le model
         model.addAttribute("filmAttribute", new Film());
     
     
         return "addfilm";
     }
            /**
         * Ajoute un nouveau film
         */
              @RequestMapping(value = "/add", method = RequestMethod.POST)
        public String postAdd(@ModelAttribute("personAttribute") Film film)
            {
     
                // Delegue au service
                 filmService.add(film);
                return "admin";
            }
     
     
    }
    b) SpettacoloController.java

    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
     
    package starcinema.controller;
     
     
    import javax.annotation.Resource;
     
    import org.springframework.stereotype.Controller;
    import org.springframework.ui.Model;
    import org.springframework.web.bind.annotation.ModelAttribute;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestMethod;
    import org.springframework.web.bind.annotation.RequestParam;
    import starcinema.model.Spettacolo;
    import starcinema.services.FilmServices;
    import starcinema.services.SpettacoloServices;
     
    /**
     *
     * @author simon
     */
    @Controller
    @RequestMapping("/spettacolo")
    public class SpettacoloController 
    {
     
        @Resource(name="spettacoloService")
        private SpettacoloServices spettacoloService;
         @Resource(name="filmService")
        private FilmServices filmService;
     
          /**
         * Recupere la page pour ajouter un nouveau spectacle
         */
          @RequestMapping(value = "/add", method = RequestMethod.GET)
             public String listspettacolo(@RequestParam("idfilm") Integer idfilm, Model model)
          {
     
                // Prepare le model objet
               Spettacolo spettacolo = new Spettacolo();
               spettacolo.setFilm(filmService.get(idfilm));
               // Ajoute dans le model
             model.addAttribute("spettacoloAttribute", spettacolo);
                return "addspettacolo";
          }
         /**
         * Ajoute un nouveau spectacle
         */
           @RequestMapping(value = "/add", method = RequestMethod.POST)
     
       public String postAdd(@RequestParam("idfilm") Integer idfilm, @ModelAttribute("spettacoloAttribute") Spettacolo spettacolo)
     
          {
     
                // Delegue au service
                spettacoloService.add(idfilm, spettacolo);
                //Ritorna les films et spectacles correspondants
                return "redirect:/starcinema/film/list";
          }
    }
    4) File jsp

    a) admin.jsp
    Il contient des liens qui me permettront d'ajouter un film et un spectacle

    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
     
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
     
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
     
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Admin</title>
      </head>
      <body>
        <h1>Administrator</h1>
        <br/>
     
        <c:url var="addUrlfilm" value="/starcinema/film/add" />
        <c:url var="addUrlspettacolo" value="/starcinema/spettacolo/add"/>
        <p><a href="${addUrlfilm}">Insert new film</a></p>
        <p><a href="${addUrlspettacolo}">Insert new spettacolo/a></p>
     
      </body>
    </html>
    b) addfilm.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
     
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>ADDFILM</title>
    </head>
    <body>
     
        <h1>Inserisce un nuovo film</h1>
     
    <c:url var="saveUrl" value="/starcinema/film/add" />
    <form:form modelAttribute="filmAttribute" method="POST" action="${saveUrl}">
     <table>
      <tr>
       <td><form:label path="titolo">Titolo:</form:label></td>
       <td><form:input path="titolo"/></td>
      </tr>
     
      <tr>
       <td><form:label path="descrizione">Descrizione</form:label></td>
       <td><form:input path="descrizione"/></td>
      </tr>
     
      <tr>
       <td><form:label path="linktrailer">Trailer</form:label></td>
       <td><form:input path="linktrailer"/></td>
      </tr>
      <tr>
       <td><form:label path="nomeimmagine">Image</form:label></td>
       <td><form:input path="nomeimmagine"/></td>
      </tr>
     </table>
     
     <input type="submit" value="Save" />
    </form:form>
     
    </body>
    </html>
    c) addspettacolo.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
     
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title><img src="images/img/admin.jpg"/> ADMIN </title>
      </head>
    <body>
     
    <h1>Add new spettacolo</h1>
     
    <c:url var="saveUrl" value="/starcinema/spettacolo/add?idfilm=${idfilm}" />
    <form:form modelAttribute="spettacoloAttribute" method="POST" action="${saveUrl}">
     <table>
     
      <tr>
       <td>Id film:</td>
       <td><input type="text" value="${idfilm}" disabled="true"/>
      </tr>
     
      <tr>
       <td><form:label path="prezzo">Prezzo:</form:label></td>
       <td><form:input path="prezzo"/></td>
      </tr>
     
      <tr>
       <td><form:label path="ore">Ora:</form:label></td>
       <td><form:input path="ore"/></td>
      </tr>
       <tr>
       <td><form:label path="data">Data:</form:label></td>
       <td><form:input path="data"/></td>
      </tr>
       <tr>
       <td><form:label path="numsala">Sala:</form:label></td>
       <td><form:input path="numsala"/></td>
      </tr>
     </table>
     
     <input type="submit" value="Save" />
    </form:form>
     
    </body>
    </html>

    d) programmazione.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
     
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ page language="java" contentType="text/html; charset=UTF-8"pageEncoding="UTF-8"%>
     
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title><img src="images/img/star.jpg"/>CINEMA</title>
        </head>
        <body>
     
             <table border="3">
          <tr><th>ID</th><th>Titolo</th><th>Descrizione</th><th>LinkTrailer</th><th>Nomeimmagine</th><th>Prezzo</th><th>Ora</th><th>Data</th><th>Sala</th></tr>
          <c:forEach var="film" items="${films}">
          <c:if test="${!empty film.spettacolo}">
              <c:forEach var="spettacolo" items="${film.spettacolo}">
            <tr>
                <td>${film.idfilm}</td>
              <td>${film.titolo}</td>
              <td>${film.descrizione}</td>
              <td>${film.linktrailer}</td>
              <td>${film.nomeimmagine}</td>
              <td>${spettacolo.prezzo}</td>
              <td>${spettacolo.ore}</td>
              <td>${spettacolo.data}</td>
              <td>${spettacolo.numsala}</td>
            </tr>
          </c:forEach>
            </c:if>
            <tr>
          <c:if test="${empty  film.spettacolo}">
                <td>${film.idfilm}</td>
              <td>${film.titolo}</td>
              <td>${film.descrizione}</td>
              <td>${film.linktrailer}</td>
              <td>${film.nomeimmagine}</td>
              </tr>
          </c:if>
            </c:forEach>
        </table>
     
        <br/>
     
     
     
            </body>
    </html>
    e) redirect.jsp (pour la redirection)

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    <%--
    Views should be stored under the WEB-INF folder so that
    they are not accessible except through controller process.
     
    This JSP is here to provide a redirect to the dispatcher
    servlet but should be the only JSP outside of WEB-INF.
    --%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <% response.sendRedirect("/starcinema/admin"); %>

    5) Configuration

    a) web.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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/applicationContext.xml</param-value>
     
        </context-param>
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        <servlet>
            <servlet-name>dispatcher</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <load-on-startup>2</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>dispatcher</servlet-name>
            <url-pattern>/starcinema/*</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>redirect.jsp</welcome-file>
        </welcome-file-list>
    </web-app>
    b) Dispatcherservlet.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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:p="http://www.springframework.org/schema/p"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:mvc="http://www.springframework.org/schema/mvc"
     
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
     
           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
     
     http://www.springframework.org/schema/mvc 
       http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
     
      <context:component-scan base-package="starcinema"/>
      <context:annotation-config/>
      <mvc:annotation-driven /> 
     
     
      <bean id="viewResolver"
            class="org.springframework.web.servlet.view.InternalResourceViewResolver"
            p:prefix="/WEB-INF/jsp/"
            p:suffix=".jsp" />
      </beans>
    c) ApplicationContext.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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:p="http://www.springframework.org/schema/p"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
     
         <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
          <!--property name="dataSource"><ref local="dataSource"/></property-->
          <property name="configLocation">
              <value>classpath:hibernate.cfg.xml</value>
          </property>
      </bean>
     
     
     
     
    </beans>
    Merci d'avance pour votre aide!

  20. #20
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
        <servlet-mapping>
            <servlet-name>dispatcher</servlet-name>
            <url-pattern>/starcinema/*</url-pattern>
    Cà, ça veux dire que ton application spring est accessible avec des urls de la forme

    http://serveur/<webapp>/starcinema/<etc>


    Hor, tu tente d'accéder à

    http://serveur/starcinema/admin

    d'après ton erreur. Il manque le nom de ta webapp dans ton url. par défaut, elle a le même nom que le war. Si tu as un doute, ca doit être dans les logs de démarrage de ta webapp, une ligne genre
    finished deploying webapplication blablabla
    ou
    deployed context blablabla

Discussions similaires

  1. [Erreur HTTP 400] Bad request.
    Par ZeKiD dans le forum Subversion
    Réponses: 0
    Dernier message: 16/08/2011, 15h36
  2. Erreur HTTP 400 avec mechanize, proxy et https
    Par poupoune2001 dans le forum Réseau/Web
    Réponses: 1
    Dernier message: 26/05/2008, 13h38
  3. [Tomcat] Erreur HTTP 500
    Par gandalf_le_blanc dans le forum Tomcat et TomEE
    Réponses: 2
    Dernier message: 23/08/2004, 15h26
  4. [Tomcat][Eclipse] erreur http 404 à l'exécution de servlet
    Par mayjo dans le forum Tomcat et TomEE
    Réponses: 6
    Dernier message: 30/07/2004, 18h19
  5. [Htaccess] Gérer les erreurs HTTP du type 404...
    Par Marshall_Mathers dans le forum Apache
    Réponses: 4
    Dernier message: 01/07/2004, 10h29

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