2011-11-14 55 views
0

こんにちは、私はdevelopperを使って簡単なデモを行っていますが、hibernate spring jsp を使っていますが、私はページindex.jspをgererArticleに入れたいと思っています。 JSP erreurは私にorg.springframework.web.servlet.PageNotFound - URIを持つHTTPリクエストのマッピングが見つかりません

709896をappearesされる[HTTP-8080から1] org.springframework.web.servlet.PageNotFound WARN - 名前でURIを持つHTTPリクエストが見つかりませんマッピング[/ExempleAchref/GererArticle.html]のDispatcherServletでの'exemple'

これはweb.xmlの

<?xml version="1.0" encoding="ISO-8859-1"?> 
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 



<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value>/WEB-INF/hibernateDataAccessContext.xml /WEB-INF/applicationContext.xml</param-value> 
</context-param> 



<context-param> 
    <param-name>log4jConfigLocation</param-name> 
    <param-value>/WEB-INF/classes/log4j.properties</param-value> 
    </context-param> 



    <listener> 
    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> 
    </listener> 

    <listener> 
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
</listener> 





    <!-- Register a servlet that despatches requests to registered controllers --> 
    <servlet> 
    <servlet-name>exemple</servlet-name> 
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
    <load-on-startup>1</load-on-startup> 
    </servlet> 


    <!-- Send all .html files to the Spring dispatcher servlet --> 


    <servlet-mapping> 
    <servlet-name>exemple</servlet-name> 
    <url-pattern>*.html</url-pattern> 
    </servlet-mapping> 





    <!-- Define the web application entry point --> 
    <welcome-file-list> 
    <welcome-file>index.jsp</welcome-file> 
    </welcome-file-list> 

</web-app> 
です

このapplication.xmlに

<?xml version="1.0" encoding="UTF-8"?> 
<!-- 
    - Application context containing authentication, channel 
    - security and web URI beans. 
    - 
    - Only used by "filter" artifact. 
    - 
    --> 

<b:beans xmlns:b="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:context="http://www.springframework.org/schema/context" 
    xmlns:jee="http://www.springframework.org/schema/jee" 
    xmlns:tx="http://www.springframework.org/schema/tx" 



    xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd 
     http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd 
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd 
     http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 
     http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
     "> 


    <!-- Auto-detect components 
    <context:component-scan base-package="com.bd.entity"/> --> 
    <b:import resource="hibernateDataAccessContext.xml"/> 


</b:beans> 

これはexemple-servlet.xml

<?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: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-2.5.xsd 
          http://www.springframework.org/schema/mvc 
          http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd 
          http://www.springframework.org/schema/context 
          http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 

    <!-- Auto-detect controllers 
    <context:component-scan base-package="com.bd.controleur"/> --> 

<!-- the mvc resources tag does the magic --> 
<mvc:resources mapping="/resources/**" location="/resources/" /> 
    <!-- also add the following beans to get rid of some exceptions --> 
<bean  class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /> 
<bean 
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"> 
</bean> 


    <!-- Prepend /WEB-INF/jsp/ and append .jsp to the logical view name --> 
    <bean id="viewResolver" 
     class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
    <property name="prefix" value="/WEB-INF/jsp/"/> 
    <property name="suffix" value=".jsp"/> 
    <property name="order" value="1" /> 
    </bean> 

    <!-- Access resource bundles with the specified basename --> 
    <bean id="messageSource" 
    class="org.springframework.context.support.ReloadableResourceBundleMessageSource" 
    p:basename="/WEB-INF/messages"/> 

</beans> 

このhibernateDataAccessContext.xml

<?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:context="http://www.springframework.org/schema/context" 
    xmlns:jee="http://www.springframework.org/schema/jee" 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/context http://www.springframework.org/schema/context/spring-context-2.5.xsd 
     http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd 
     http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> 

    <!-- Auto-detect the DAOs 
    <context:component-scan base-package="com.bd.dao"/> --> 

    <context:property-placeholder location="WEB-INF/jdbc.properties"/> 


    <bean id="dataSource" 
     class="org.springframework.jdbc.datasource.DriverManagerDataSource"> 
     <property name="driverClassName" value="${database.driver}" /> 
     <property name="url" value="${database.url}" /> 
     <property name="username" value="${database.user}" /> 
     <property name="password" value="${database.password}" /> 
    </bean> 



    <bean id="sessionFactory" 
     class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> 
     <property name="dataSource" ref="dataSource" /> 
     <property name="annotatedClasses"> 
      <list> 
       <value>com.bd.entity.Article</value> 

      </list> 
     </property> 
     <property name="hibernateProperties"> 
      <props> 
       <prop key="hibernate.dialect">${hibernate.dialect}</prop> 
       <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>  
       <!-- generation base donnée  <prop key="hibernate.hbm2ddl.auto">create-drop</prop> --> 
     <prop key="hibernate.hbm2ddl.auto">create-drop</prop> 
      </props> 
     </property> 
     <property name="eventListeners"> 
<map> 
<entry key="merge"> 
<bean class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/> 
</entry> 
</map> 
</property> 
    </bean> 




    <tx:annotation-driven transaction-manager="txnManager"/> 

    <bean id="txnManager" 
     class="org.springframework.orm.hibernate3.HibernateTransactionManager" 
     p:sessionFactory-ref="sessionFactory"/> 

    <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/> 

</beans> 

答えて

0

あなたは、コントローラのコードを投稿していなかった - 私は単にあなたを想定しますマッピングのコントローラがミスヒットしました/GererArticle

関連する問題