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 :

Problème de configuration " Spring "


Sujet :

Spring Web Java

  1. #1
    Membre confirmé Avatar de jdev23
    Profil pro
    Étudiant
    Inscrit en
    Août 2006
    Messages
    99
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Maroc

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2006
    Messages : 99
    Par défaut Problème de configuration " Spring "
    Bonjour,

    Je suis en train de developper ma première application web avec spring,donc j'ai voulu créer un projet web en utilisant Spring,hibernate et JSF,je suis sur Netbeans 6 j'utilise Spring web MVC 2.5,j'ai essayé de configurer le fichier applicationContext.xml
    mais aprés le déploiment du projet j'ai le message suivant :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    type Rapport d'état
     
    message /SpringTest/
     
    description La ressource demandée (/SpringTest/) n'est pas disponible.

    voici mon fichier 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
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
     
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" 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_2_5.xsd">
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/applicationContext.xml</param-value>
        </context-param>
        <context-param>
            <param-name>com.sun.faces.verifyObjects</param-name>
            <param-value>false</param-value>
        </context-param>
        <context-param>
            <param-name>com.sun.faces.validateXml</param-name>
            <param-value>true</param-value>
        </context-param>
        <context-param>
            <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
            <param-value>client</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>
            <servlet-name>Faces Servlet</servlet-name>
            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>dispatcher</servlet-name>
            <url-pattern>*.htm</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>Faces Servlet</servlet-name>
            <url-pattern>/faces/*</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout> 
                30
            </session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>faces/createToDo.jsp</welcome-file>
        </welcome-file-list>
    </web-app>
    et voilà le fichier applcationContext.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
    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
     
    <?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-2.5.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
        <!-- ADD PERSISTENCE SUPPORT HERE (jpa, hibernate, etc) -->
     
        <!-- DataSource Definition -->
    <bean id="dataSource"
            class="org.apache.commons.dbcp.BasicDataSource"
            destroy-method="close">
            <property name="driverClassName">
                   <value>org.postresql.jdbcDriver</value>
            </property>
            <property name="url">
                   <value>jdbc:postgresql://localhost:5432/postgres</value>
            </property>
            <property name="username">
                   <value>user</value>
            </property>
            <property name="password">
                   <value>pass</value>
            </property>
    </bean>
    <!-- Hibernate SessionFactory Definition -->
    <bean id="sessionFactory"
            class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            <property name="mappingResources">
                   <list>
                           <value>Mapping.User.hbm.xml</value>
                   </list>
            </property>
            <property name="hibernateProperties">
                   <props>
                           <prop key="hibernate.dialect">
                                   org.hibernate.dialect.HSQLDialect
                           </prop>
                           <prop key="hibernate.show_sql">true</prop>
                           <prop key="hibernate.cglib.use_reflection_optimizer">
                                   true
                           </prop>
                           <prop key="hibernate.cache.provider_class">
                                   org.hibernate.cache.HashtableCacheProvider
                           </prop>
                   </props>
            </property>
            <property name="dataSource">
                   <ref bean="dataSource" />
            </property>
    </bean>
    <!-- Spring Data Access Exception Translator Defintion -->
    <bean id="jdbcExceptionTranslator"
            class="org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator">
            <property name="dataSource">
                   <ref bean="dataSource" />
            </property>
    </bean>  
    </beans>
    Merci de m'aider,parceque je suis vraiment novice sur Spring

  2. #2
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    51
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Janvier 2007
    Messages : 51
    Par défaut
    Salut,

    Tu as un exemple très simple d'une application Web à cette adresse qui peut te servir de point de départ dans ton apprentissage :

    http://blog.developpez.com/djo-mos?t...r_sprin#c37883

Discussions similaires

  1. Problème sur Request.ServerVariables("QUERY_STRING"
    Par PrinceMaster77 dans le forum ASP
    Réponses: 3
    Dernier message: 25/03/2005, 11h47

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